How do we turn-back-on ACK's builtin "realtime"?

Chris H.'s Ultima / ACS-style game development system!

Moderators: Ice Cream Jonsey, joltcountry

User avatar
Garth's Equipment Shop
Posts: 638
Joined: Fri Dec 05, 2008 5:55 pm
Location: Festering Foothills
Contact:

How do we turn-back-on ACK's builtin "realtime"?

Post by Garth's Equipment Shop »

This is actually a request for a patch. The patch doesnt exist yet as of the writing of this post. But I am hopeful that rld may be able to locate the place in the code where Chris had turned it off and provide us a patch with which we may turn it back on for certain games if we wish.

I recently played Ultima 5 and the first thing I noticed was constant movement. Torches and stove flames flickering, fountains and waterfalls flowing, sharks swimming, monsters, npcs and the player character all animating even when idle. And of course there is the time element of the game. It doesnt stop, even when the PC is idle. I remembered somewhere on here Chris mentioned something about originally making ACK like that since it was afterall largely created to make Ultima games, but he said he decided to keep it turned off.

So how do we turn it back on is all I want to know. It would be extremely useful to me.

I know i have other projects I need to finish but playing Runescape online has really drawn me back into Fantasy RPGing and has inspired me to plan out my first completely original [not remake of something else in other words] high fantasy ACK design. There seems to be no end to the creative ideas that keep pouring in for this. Perhaps its because I steered clear of fantasy for so many years preferring post-apocalyptic, survival horror and dark dystopian or cyberpunk sci-fi.
Which of you is interested in my fine wares?

rld
Posts: 223
Joined: Sun Jan 25, 2009 2:17 am
Location: Dallas, TX

Post by rld »

I took a look at this. The problem is that it really isn't an on-or-off kind of feature in ACK.

There is a mechanism in ACK that can be used to 'time out' the player's input after a certain period of time and force the key command to a particular value. If you look in the source code, the relevant variables are called "readkey_time" and "readkey_default".

At first glance, this would seem to be the way to force 'real time' behavior by having the engine time out and let creatures move, step macros run, etc. if the player does not move in a specified period of time.

The problem is that this same mechanism is used in the code right now for a host of other, overlapping functions. It is used to implement the 'moving sidewalk spaces', it is used as part of portal processing, and in a number of other places.

So, when I tried to use this to force real-time behavior in a patch, I was able to get it to work, in a sense; I got creatures to move while the player was standing still. But the change also broke portals completely, and broke who knows how many other things.

I may take another look at it later when I have a bit more time, but it doesn't look like an easy change at this point. Chris may be able to shed more light on this (or tell us if what we are trying to do is even possible without massive code rework).

User avatar
Garth's Equipment Shop
Posts: 638
Joined: Fri Dec 05, 2008 5:55 pm
Location: Festering Foothills
Contact:

Post by Garth's Equipment Shop »

Thanks for looking into the realtime request rld. So could we perhaps make other objects that animate as a kind of independent process using the same process the moving sidewalks do?

I'm actually fine with how the game mechanics work in general, turn based combat and all that. It is just that I would like to have some objects animate independent of the turn based processing.

Though it might also be useful to run certain macros independent as well, like to create a special event of some kind or to show a skill being performed repeatedly untill either inventory becomes too full to hold whatever the skill might produce [like ore if mining, logs if woodcutting, vegetables if harvesting, etc.] or the skill loop is broken by a new command like an arrow key or something.
Which of you is interested in my fine wares?

rld
Posts: 223
Joined: Sun Jan 25, 2009 2:17 am
Location: Dallas, TX

Post by rld »

What would be interesting is if you could run a macro as a real-time event; that is, run macro X every second (or two or three) when the player was idle. Then this macro could run whatever animations/actions you were interested in. Kind of like the step macro, but a real-time version.

I tried to add this in by modifying the routine that waits for the player to hit a key to run a macro periodically, but it doesn't seem to be working and I haven't figured out why yet.

Of course, you would have issues when the player does something that takes more than a second, like picking items from inventory, or reading messages. If the player spends 30 seconds reading a long message, do you want the 'real-time' macro to run 30 times when the player returns? Probably not, but this illustrates the difficulty of trying to graft real-time events onto a turn-based engine.

User avatar
Garth's Equipment Shop
Posts: 638
Joined: Fri Dec 05, 2008 5:55 pm
Location: Festering Foothills
Contact:

Post by Garth's Equipment Shop »

Ok how about this then? We already have the hourly macro. Why not a "second hand" macro? A macro that runs with the movement of the second hand on the game clock? The game already keeps track of time right? There must already be a variable built in to tick off the seconds in order for the clock to be able to count up minutes right? There's got to be a way to exploit this.

There was also an old trick in RPG Maker to achieve some effects. You could make a copy of your tile set and only change certain tiles, like say the water autotiles. Then you just have the game switch tilesets back and forth to achieve animated water effect. Using this method you could actually have every tile in your set animate between two different tiles if you so desired, though that would be going a bit overboard, it was cool that it could be done. Ofcourse this worked because RPGMaker is realtime to begin with.

But it would still be cool if you could switch the tileset from a macro in ACK even if we cant have any realtime or cant run a 'second-hand' macro. So we could have it switch from a step macro, or we could achieve a kind of major special event effect like turning a bunch of people icons into zombie versions of themselves all at once [ofcourse we'd then also need to make them suddenly aggressive too].
Which of you is interested in my fine wares?

User avatar
Garth's Equipment Shop
Posts: 638
Joined: Fri Dec 05, 2008 5:55 pm
Location: Festering Foothills
Contact:

Post by Garth's Equipment Shop »

rld wrote:Of course, you would have issues when the player does something that takes more than a second, like picking items from inventory, or reading messages. If the player spends 30 seconds reading a long message, do you want the 'real-time' macro to run 30 times when the player returns? Probably not, but this illustrates the difficulty of trying to graft real-time events onto a turn-based engine.
True but it wouldn't be an issue if it were limited to passive actions like changing an object's icon, and maybe allow all of the normal macro commands to run in this special macro but they are treated as normal turn based commands and not realtime [designated as 'run once']. EDIT: ok scratch that last part about allowing all the normal macro commands to run from the special realtime macro. That wouldn't work obviously. And we can always have regular macros to do those other things that aren't realtime. So basically the only command we would need to run realtime is the command to change an object's icon. Would be nice to have such a command wouldn't it? ;)
Which of you is interested in my fine wares?

Chris H
Posts: 272
Joined: Sun Dec 02, 2007 4:07 pm
Location: California, USA

Post by Chris H »

Holy crap he's still alive...

This shouldn't be too crazy hard to re-enable if you really wanted it... essentially it was the equivalent of the Ultima games where if you sat there and did nothing, it would pass a turn every so often. Yes, the feature is also used by portals (they use a timeout of zero, essentially it's the engine's way of forcing a turn to pass when you step onto the portal so that the display fully updates) and it's also used - more properly - by terrain that auto-moves you after a certain time. (the slidewalks at the end of the tutorial are a good example, if you sit and do nothing there's an automatic move)

Long ago the automatic timeout "pass a turn" was the default, I changed it because it's a turn-based game and all it really seemed to be doing was giving the player the added hassle of having to use a 'pause' feature. (If a player really wants to just sit and wait, they're going to hit the space bar a bunch of times)

Animation should still be going on even when you're just sitting there, though. If that's not happening, something's wrong...

Anyway, re-enabling the timeout thing would either be a matter of...

1. finding where in the code it says "arcade:=false" and change false to true... that was originally the mode switch, it may or may not still work
or,
2. find where it assigns the default readkey result value and timeout (I'd have to poke in the code to see where this happens) and change the result value to ascii #32. (the whole thing with automatic cycling of the engine is, after all, still going on... it's just going on in a way that doesn't give NPCs a turn or pass any time.)

I'll try to become a more frequent lurker on here ;) Work is still insane though.

- Chris

User avatar
Garth's Equipment Shop
Posts: 638
Joined: Fri Dec 05, 2008 5:55 pm
Location: Festering Foothills
Contact:

Post by Garth's Equipment Shop »

Chris H wrote:Holy crap he's still alive...
Hallelujah! I was gettin worried mate. Very glad to see you back here again Chris.
Chris H wrote:Animation should still be going on even when you're just sitting there, though. If that's not happening, something's wrong...
Hmm, maybe I've been in design mode too long and not enough play mode. I'll load up one of your designs and check it out. For some reason I remembered animations only occuring as a step event type deal.

Chris H wrote:I'll try to become a more frequent lurker on here ;) Work is still insane though.
Awesome! Hope work eases off on you a bit, or you atleast get a breather now and then.
Which of you is interested in my fine wares?

Chris H
Posts: 272
Joined: Sun Dec 02, 2007 4:07 pm
Location: California, USA

Post by Chris H »

Nope - animation cycles while the game is waiting for a keypress. You can even set the speed in the config editor (although slower speeds look kind of silly, this was mostly a throwback to the days when the CPU just couldn't keep up with the animation)

User avatar
Garth's Equipment Shop
Posts: 638
Joined: Fri Dec 05, 2008 5:55 pm
Location: Festering Foothills
Contact:

Post by Garth's Equipment Shop »

Thats great thanks Chris. Sorry for jumping the gun on that one, i feel silly now. I hadn't really experimented with animations yet as I was so absorbed in all the other cool stuff you can do with the editors.
Which of you is interested in my fine wares?

Post Reply