Real Time

“When you want to change this fact, you need to alter the “opinion” of the game towards the character; rewrite every line of code so your actions depend on the real_time<–>game_time scale (if you wanted 20 mins to be a day in game, for example) and define the speed factor of every instance and its iteration. You get the drill? :-D”

The code is already made. The game is the code. The game has the code. this just passes a turn every X time. Like Jcannon said, in some words that describe exactly what i want to say. “Really? I can’t imagine it is THAT hard. I don’t know much about C++ but have a call every loop that checks time since last loop. If time passed is greater than 2 seconds, then call the “next turn” function. If movement received, reset the timer. Unless of course CATA doesn’t update every frame but only when actions occur. Then that would be harder.”

“Now, it’s easy to achieve this if the game is Space Invaders or an Arcanoid clone, for example. Even the levels that are there are dependent on your actions, but the timeline’s enclosed so it’s rather simple (think of the time schedule of a TV network’s channel). It’s when you have an open world like this that the zounds and zounds of problems arise, because you have whole areas to load into memory and render them “playable” - doing so along the game_timeline.”

Oh, sometimes my english fails. I really can’t understand that completely.

“because you have whole areas to load into memory and render them “playable” - doing so along the game_timeline.”

If here you are saying about the game load, i think it is not that big of a load. I can play smashing and spamming “.”

I don’t really mean to discourage anyone, altough I think that for CataDDA this could be manageable only with some SPECIAL mode of a sort, like defense or pit_monsters where you get to decide on the actual pace. There’s a reason the genre is sometimes called “dungeon crawling” - it’s the best thing to put in front of turn-based logic.
[/quote]

Ok, ok, you’re it.
Swing by the “Programming Language” topic - it’s somewhere within the General Discussion child board. There are a couple of nice SDL tutorials I’d like to share with you, when you are ready. Hint - It’s a fairly simple task, really; animation and 2D rendering. It’s the viewport you need to look upon, being it’s a simple platformer; the aim of the tutorial.

I never said you couldn’t mod this game, but the exact opposite. The main.cpp here just does not comply with your demands at the present.

Couple of weeks before I was looking at these 50 or so lines of code in mofo BASIC this guy had punched in to make Minesweeper, and I was struck with the sincere simplicity of the code. Looks so, oh so so so much simpler when you look at the solution rather than having the problem yourself. But that’s turn based, so you probably wouldn’t enjoy it. :slight_smile:
I can, however, offer you something much, much closer to your needs. The simplest game in real time.

[code]
; -----------------------------------------------------------------------------
; Example quick-start “windowed-game with timing” template…
; -----------------------------------------------------------------------------
; xxxxx @ xx-xxxx.com
; -----------------------------------------------------------------------------

; -----------------------------------------------------------------------------
; Event constants…
; -----------------------------------------------------------------------------

Const EVENT_None = $0 ; No event (eg. a WaitEvent timeout)
Const EVENT_KeyDown = $101 ; Key pressed
Const EVENT_KeyUp = $102 ; Key released
Const EVENT_ASCII = $103 ; ASCII key pressed
Const EVENT_MouseDown = $201 ; Mouse button pressed
Const EVENT_MouseUp = $202 ; Mouse button released
Const EVENT_MouseMove = $203 ; Mouse moved
Const EVENT_Gadget = $401 ; Gadget clicked
Const EVENT_Move = $801 ; Window moved
Const EVENT_Size = $802 ; Window resized
Const EVENT_Close = $803 ; Window closed
Const EVENT_Front = $804 ; Window brought to front
Const EVENT_Menu = $1001 ; Menu item selected
Const EVENT_LostFocus = $2001 ; App lost focus
Const EVENT_GotFocus = $2002 ; App got focus
Const EVENT_Timer = $4001 ; Timer event occurred

; -----------------------------------------------------------------------------
; Create a window…
; -----------------------------------------------------------------------------

; FLAGS…

; 1 : window has titlebar
; 2 : window is resizable
; 4 : window has a menu
; 8 : window has a status bar
; 16 : window is a ‘tool’ window - smaller title bar etc.
; 32 : window uses size given for client area (inner area)…

window = CreateWindow (“Game Window (use cursors)…”, 0, 0, 640, 480)

; -----------------------------------------------------------------------------
; Create a menu…
; -----------------------------------------------------------------------------

; Note that the & sign in these examples underlines the next letter, and a
; blank menu name creates a ‘bar’…

mainmenu = CreateMenu ("&Game", 0, WindowMenu (window))
CreateMenu “&About”, 1, mainmenu
CreateMenu “”, 2, mainmenu
CreateMenu “E&xit”, 3, mainmenu

UpdateWindowMenu window ; This MUST be called after creating your menu!

; -----------------------------------------------------------------------------
; Create a drawing area and ‘pin’ all edges to parent window…
; -----------------------------------------------------------------------------

canvas = CreateCanvas (0, 0, ClientWidth (window), ClientHeight (window), window)
SetGadgetLayout canvas, 1, 1, 1, 1 ; Use zero to leave an edge ‘unpinned’…

; -----------------------------------------------------------------------------
; All future drawing goes into the drawing area…
; -----------------------------------------------------------------------------

SetBuffer CanvasBuffer (canvas)

; -----------------------------------------------------------------------------
; Frame timing stuff…
; -----------------------------------------------------------------------------

fps = CreateTimer (60)

; -----------------------------------------------------------------------------
; Main loop…
; -----------------------------------------------------------------------------

Repeat

; -------------------------------------------------------------------------
; Event processing loop (repeats until 'fps' timer event occurs)...
; -------------------------------------------------------------------------

Repeat

	e = WaitEvent (1) ; The 'wait' value comes from above section...

	; ---------------------------------------------------------------------
	; Got events, so process them...
	; ---------------------------------------------------------------------
	
	Select e

		; Close gadget hit...		
		Case EVENT_Close
			End
		
		; Menu item selected...
		Case EVENT_Menu
		
			; -------------------------------------------------------------
			; After an EVENT_Menu event, you get the menu item number from
			; EventData ()...
			; -------------------------------------------------------------
			
			item = EventData ()
			
			Select item
				Case 1
					Notify "Game template"
				Case 3
					If Confirm ("Are you sure you want to quit?")
						End
					EndIf
			End Select
			
	End Select
	
Until e = EVENT_Timer

; -------------------------------------------------------------------------
; Drawing code example...
; -------------------------------------------------------------------------

Cls

For a = 1 To 100
	Color Rnd (100, 255), Rnd (100, 255), Rnd (100, 255)
	Rect Rand (640), Rand (480), 64, 64
Next

Color 255, 255, 255

If KeyDown (203)
	x = x - 2
EndIf

If KeyDown (205)
	x = x + 2
EndIf

If KeyDown (200)
	y = y - 2
EndIf

If KeyDown (208)
	y = y + 2
EndIf

Rect x, y, 64, 64

; -------------------------------------------------------------------------
; The Canvas version of Flip...
; -------------------------------------------------------------------------
		
FlipCanvas canvas

Until (KeyHit (1))

End[/code]