Jump to content


Photo

Would "time rewind" be possible in the TDM engine?


  • Please log in to reply
16 replies to this topic

#1 Lavender

Lavender

    Member

  • Member
  • PipPip
  • 110 posts

Posted 15 December 2017 - 04:26 AM

I had an idea - imagine a Sands of Time -style "rewind" system, but used for stealth. You explore the map, note events (maybe on an automatic notepad that gets new notes from in-map triggers) and the time they take place on, and plan an optimal route from AI movements. The map would have a deadline via a timed objective to force you to plan.

 

Obviously this type of gameplay is not for everyone - I'm not even sure it's my own cup of tea - but I'm curious as to if TDM could support this. You could simply reload the map yourself until you get it right, but that would not be quite the same. Could the map reload in the background, while in-engine events take place? Would this require engine modifications?


Edited by Lavender, 17 December 2017 - 03:17 AM.

  • Kurshok likes this

#2 Kurshok

Kurshok

    Member

  • Member
  • PipPip
  • 161 posts

Posted 15 December 2017 - 04:55 AM

Maybe as a mechanic of a magical loot item

#3 Judith

Judith

    Advanced Member

  • Member
  • PipPipPip
  • 1337 posts

Posted 15 December 2017 - 05:08 AM

The engine is capable of making time go faster or slower (albeit also lowering the FPS), but not sure if it can reverse time.



#4 demagogue

demagogue

    Mod hero

  • Active Developer
  • PipPipPipPipPip
  • 5382 posts

Posted 15 December 2017 - 06:40 AM

My intuition is it'd take quite a bit of source code tweaking.

Of course, having the full source code, anything is technically possible.

It would just have to be a fork project.

The only other option would be some very clever scripting to give the illusion of reversing time (like playing reversed animations, etc).

That'd take a lot of work too, but at least that could be played by people.


Posted Image

#5 Abusimplea

Abusimplea

    Member

  • Member
  • PipPip
  • 399 posts

Posted 15 December 2017 - 07:11 AM

Auto-restarting the map on failure is already easily scriptable. But if with "reloading" you meant going back to arbitrary points in the past... then nope - not without implementing some sort of game state history in the engine itself.

 

But for a single mission, there might be ways to fake it without changing the engine:

- Scripting saves and reloading of those

- Storing the state history (like locations and status changes) for selected game world objects and reinitializing those on demand.

 

The id Tech 4 scripting system is touring complete but does not support arrays of arbitrary lengths. So you probably would need to invent some workaround for that (maybe by using custom entities for storage) to keep track of the selected entities' state or created saves.


Edited by Abusimplea, 15 December 2017 - 07:11 AM.


#6 Destined

Destined

    Advanced Member

  • Member
  • PipPipPip
  • 1520 posts

Posted 15 December 2017 - 09:19 AM

For this type of gameplay (rewind while stealthing) you could take a look at the game "Shadwen". This game does exactly this.



#7 Lavender

Lavender

    Member

  • Member
  • PipPip
  • 110 posts

Posted 15 December 2017 - 10:56 AM

Auto-restarting the map on failure is already easily scriptable. But if with "reloading" you meant going back to arbitrary points in the past... then nope - not without implementing some sort of game state history in the engine itself.

 

But for a single mission, there might be ways to fake it without changing the engine:

- Scripting saves and reloading of those

- Storing the state history (like locations and status changes) for selected game world objects and reinitializing those on demand.

 

The id Tech 4 scripting system is turing complete but does not support arrays of arbitrary lengths. So you probably would need to invent some workaround for that (maybe by using custom entities for storage) to keep track of the selected entities' state or created saves.

Hmm, could saves be made to and kept in memory while the mission is loaded?


Edited by Lavender, 17 December 2017 - 03:17 AM.


#8 Abusimplea

Abusimplea

    Member

  • Member
  • PipPip
  • 399 posts

Posted 15 December 2017 - 01:27 PM

For this type of gameplay (rewind while stealthing) you could take a look at the game "Shadwen". This game does exactly this.

Doing it like in shadwen would certainly need C code inside the engine.
 

Hmm, could saves be made to and kept in memory while the mission is loaded?

This would also need code in the engine. It seems to be possible to safe and load to and from disk by script though. The wiki page about Saint Lucia mentions the needed script "events". Fun fact: That page about a mission also is the only page to mention the loadGame "event". saveGame is also mentioned in the TDM Script Reference...



#9 Obsttorte

Obsttorte

    Scripting guru, Mapper

  • Active Developer
  • PipPipPipPipPip
  • 5609 posts

Posted 16 December 2017 - 03:07 AM

I had an idea - imagine a Sands of Time -style "rewind" system, but used for stealth. You explore the map, note events (maybe on an automatic notepad that gets new notes from in-map triggers) and the time they take place on, and plan an optimal route from AI movements. The map would have a deadline via a timed objective to force you to plan.

 

Obviously this type of gameplay is not for everyone - I'm not even sure it's my own cup of tea - but I'm curious as to if TDM could support this. You could simply reload the map yourself until you get it right, but that would not be quite the same. Could the map reload in the background, while in-engine events take place? Would this require engine modifications?

I thought about something like this a while ago, too. Sort of "Groundhog Day". The most direct approach would be to reset the game via loading a saved game (or simple restarting the mission), but allow for an additional data set to allow changes to be made depending on the players actions during their previous playthrough. One possibilty that came to my mind was to use xdata, as currently used for readables. Currently this system is for read-only purpose, though (at least as far as I am aware of), so the ability to write data would need to be added. I guess this would be a minor tweak in the source code, though.

 

Doing the mission load in the background while the mission is still running would be a major change, though, and depending on how exactly the engine handles mission date it might even be an impossible undertaking. It would still be beneficial to investigate this imho, as such a feature, used by several modern games, could also be used for other purposes. Splitting up large missions into smaller ones is one thing that comes to my mind. Getting to see the loading screen is the one thing that makes this alway problematic. Think of Thief 3 compared to Thief 4.

 

Letting the time run backwards as in Sands of time would be an even more dramatic change to the source code from my expectation, and is very unlikely.

 

However, all of those things need code changes, no matter how big or small they might be. So it is nice that you "had an idea", but unless you are a coder .... :)


  • Judith and Anderson like this
FM's: Builder Roads, Old Habits, Old Habits Rebuild
WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.
Mapping and Scripting: Apples and Peaches
Sculptris Models and Tutorials: Obsttortes Models
My wiki articles: Obstipedia
Let's Map TDM YouTube playlist: ObstlerTube
Texture Blending in DR: DR ASE Blend Exporter

End of shameless self promotion.

#10 Lavender

Lavender

    Member

  • Member
  • PipPip
  • 110 posts

Posted 16 December 2017 - 06:59 AM

I thought about something like this a while ago, too. Sort of "Groundhog Day". The most direct approach would be to reset the game via loading a saved game (or simple restarting the mission), but allow for an additional data set to allow changes to be made depending on the players actions during their previous playthrough. One possibilty that came to my mind was to use xdata, as currently used for readables. Currently this system is for read-only purpose, though (at least as far as I am aware of), so the ability to write data would need to be added. I guess this would be a minor tweak in the source code, though.

 

Doing the mission load in the background while the mission is still running would be a major change, though, and depending on how exactly the engine handles mission date it might even be an impossible undertaking. It would still be beneficial to investigate this imho, as such a feature, used by several modern games, could also be used for other purposes. Splitting up large missions into smaller ones is one thing that comes to my mind. Getting to see the loading screen is the one thing that makes this alway problematic. Think of Thief 3 compared to Thief 4.

 

Letting the time run backwards as in Sands of time would be an even more dramatic change to the source code from my expectation, and is very unlikely.

 

However, all of those things need code changes, no matter how big or small they might be. So it is nice that you "had an idea", but unless you are a coder .... :)

Yes, I'm not expecting anyone to do the work for me, so to speak. Ideas are cheap, implementations are hard. I was curious if something like this would be possible already using mapping and scripting. It sound like a mapper might at least be able to create an illusion of something similar, using a lot of mapping "stagecraft".

 

This would also need code in the engine. It seems to be possible to safe and load to and from disk by script though. The wiki page about Saint Lucia mentions the needed script "events". Fun fact: That page about a mission also is the only page to mention the loadGame "event". saveGame is also mentioned in the TDM Script Reference...

Also, I guess the scripting system is still in need of more complete documentation, as the ref page is from january 2015? Let's say I had some time for it, how can I look at what functions are available? Is diving into the source the only way, or are there tools for listing existing functions?


Edited by Lavender, 17 December 2017 - 03:17 AM.


#11 Boiler's_hiss

Boiler's_hiss

    Member

  • Member
  • PipPip
  • 18 posts

Posted 16 December 2017 - 11:41 AM

One of the maps below could be a proof of concept, yet I can't say, will it meet expectations.
http://www.moddb.com...-contest-1-maps



#12 Lavender

Lavender

    Member

  • Member
  • PipPip
  • 110 posts

Posted 17 December 2017 - 05:57 AM

One of the maps below could be a proof of concept, yet I can't say, will it meet expectations.
http://www.moddb.com...-contest-1-maps

Not quite sure what you mean. Do these maps feature time manipulation scripting?



#13 Boiler's_hiss

Boiler's_hiss

    Member

  • Member
  • PipPip
  • 18 posts

Posted 17 December 2017 - 09:07 AM

I'm sorry, I had to be more clear. Map in d3sm_backintime.pk4 has architecture, swapped by something (I'm not very experienced with id tech 4) like scripting and has it explained as ostensibly time manipulation. At first, I, considering requirement of BSP recompilation, thought about teleportation between different, yet similar parts of map, but noclip revealed nothing like that.


Edited by Boiler's_hiss, 17 December 2017 - 09:08 AM.


#14 Lavender

Lavender

    Member

  • Member
  • PipPip
  • 110 posts

Posted 17 December 2017 - 09:19 AM

I'm sorry, I had to be more clear. Map in d3sm_backintime.pk4 has architecture, swapped by something (I'm not very experienced with id tech 4) like scripting and has it explained as ostensibly time manipulation. At first, I, considering requirement of BSP recompilation, thought about teleportation between different, yet similar parts of map, but noclip revealed nothing like that.

Ah, then I see what you mean. :)



#15 wesp5

wesp5

    Advanced Member

  • Member
  • PipPipPip
  • 620 posts

Posted 17 December 2017 - 09:44 AM

At first, I, considering requirement of BSP recompilation, thought about teleportation between different, yet similar parts of map, but noclip revealed nothing like that.

I think Dishonored 2 and other games use teleportation between different parts of the maps to simulate different times.



#16 Obsttorte

Obsttorte

    Scripting guru, Mapper

  • Active Developer
  • PipPipPipPipPip
  • 5609 posts

Posted 17 December 2017 - 03:23 PM

I'm sorry, I had to be more clear. Map in d3sm_backintime.pk4 has architecture, swapped by something (I'm not very experienced with id tech 4) like scripting and has it explained as ostensibly time manipulation. At first, I, considering requirement of BSP recompilation, thought about teleportation between different, yet similar parts of map, but noclip revealed nothing like that.

It is done via scripting. Parts of the map are hidden whereas others (which started hidden) are shown.


FM's: Builder Roads, Old Habits, Old Habits Rebuild
WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.
Mapping and Scripting: Apples and Peaches
Sculptris Models and Tutorials: Obsttortes Models
My wiki articles: Obstipedia
Let's Map TDM YouTube playlist: ObstlerTube
Texture Blending in DR: DR ASE Blend Exporter

End of shameless self promotion.

#17 pariah

pariah

    Member

  • Member
  • PipPip
  • 34 posts

Posted 17 December 2017 - 06:53 PM

is called saving the game.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users