Please login or register.

Login with username, password and session length
Advanced search  

News:

IRC channel - server: waelisch.de  channel: #wme (read more)

Author Topic: Patching the game. Scripts and existing save games.  (Read 5646 times)

0 Members and 1 Guest are viewing this topic.

Jihar

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 21
    • View Profile
    • CreativeDream Studio
Patching the game. Scripts and existing save games.
« on: December 22, 2008, 03:44:39 PM »

Here some questions about patching already shipped game. There is no problem in changing some graphics, sound or something like this. The main problem for me is how to patch game scripts, especially existing save games.
1. About patching scripts. Will the scripts updates in new path? If not i can make two pakages of data - one only for scripts and the second for any other game data. And in every patch if there any changes in game logic, i will manually replace or change script pakage. So if this solution will works (didnt tried yet) it will be convenient for me.
2. Patching save games. The problem is that (how i think) save games contain all compiled game scripts, and i have no idea how to patch compiled scripts inside the save game... Ill be very disappointed to notice the gamer that patch is not compatible with old saves.

Any ideas? May be its not so hard like it seems to me?
Logged

odnorf

  • w00t?
  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 7
  • Offline Offline
  • Gender: Male
  • Posts: 1456
  • Lamp dog!
    • View Profile
Re: Patching the game. Scripts and existing save games.
« Reply #1 on: December 22, 2008, 04:07:58 PM »

Those questions are answered by metamorphium in his on-line wme book.
Logged
fl*p

Spellbreaker

  • Supporter
  • Frequent poster
  • *
  • Karma: 4
  • Offline Offline
  • Gender: Male
  • Posts: 376
    • View Profile
    • Apeiron Studios
Re: Patching the game. Scripts and existing save games.
« Reply #2 on: December 22, 2008, 05:10:21 PM »


2. Patching save games. The problem is that (how i think) save games contain all compiled game scripts, and i have no idea how to patch compiled scripts inside the save game... Ill be very disappointed to notice the gamer that patch is not compatible with old saves.

Unfortunatly, this is not possible.
Logged

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: Patching the game. Scripts and existing save games.
« Reply #3 on: December 22, 2008, 09:23:37 PM »

it IS possible but requires extra scripting. the game must be designed with the possibility and from the very beginning of the design should think of such patch. You can for example intercept the event which triggers when the game position loads and reattach all scripts which are running (which would refresh them) to their recent versions.
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

sychron

  • Wanderer zwischen den Welten
  • Global Moderator
  • Regular poster
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 223
  • There is no spoon. The enemy gate is down!
    • View Profile
Re: Patching the game. Scripts and existing save games.
« Reply #4 on: December 23, 2008, 10:55:43 AM »

You can do that? ... NOW I'm surprised.
Logged
... delete the inner sleep ...

Jihar

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 21
    • View Profile
    • CreativeDream Studio
Re: Patching the game. Scripts and existing save games.
« Reply #5 on: December 23, 2008, 04:08:18 PM »

Those questions are answered by metamorphium in his on-line wme book.
Thanks for link!

it IS possible but requires extra scripting. the game must be designed with the possibility and from the very beginning of the design should think of such patch. You can for example intercept the event which triggers when the game position loads and reattach all scripts which are running (which would refresh them) to their recent versions.
Great idea!
Here how i think it may be implemented for the project, that was designed without such patching in mind. For example we need to patch scripts of two types of objects - scene or scene node. We can create an object ScriptPatcher. This object have the list of objects in wich the scripts was changed. So we call this SCriptPatcher after Game.Load, he will check - if there any changed object loaded, and if any he will reload chandeg scripts of this object.
For example, i can store the list of changed objects in file:

<scene
  name = "scenes\scene_01\scene01.scene"
  script = "scripts\some_name.script"
/>

<node
  scene = "scenes\scene_07\scene07.scene"
  name = "some_entity"
  script = "some_entity.script"
/>

For scene i need only scene name, and for object i need scene name too (cause there can be entities with the same name in different scenes). And after all of this i need only to put all needed new scripts and update this file. Will it work, how do you think?
« Last Edit: December 23, 2008, 04:11:46 PM by Jihar »
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Patching the game. Scripts and existing save games.
« Reply #6 on: December 23, 2008, 04:23:36 PM »

The problem is that (how i think) save games contain all compiled game scripts

It doesn't contain ALL scripts, it contains all scripts that are RUNNING when the player saved the game. So changing scene scripts on the fly usually isn't at all necessary, because once the player revisits the scene, new scripts will be loaded (as mentioned in meta's book).
Some sort of manual reloading mechanism would only be necessary for scripts that run all the time and never finish, such as game_loop.script. This also applies to inventory items scripts, because those are loaded when the game starts, so even if you supply new scripts in a patch package, they will never be automatically updated.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Jihar

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 21
    • View Profile
    • CreativeDream Studio
Re: Patching the game. Scripts and existing save games.
« Reply #7 on: December 24, 2008, 07:40:19 AM »

The problem is that (how i think) save games contain all compiled game scripts

It doesn't contain ALL scripts, it contains all scripts that are RUNNING when the player saved the game. So changing scene scripts on the fly usually isn't at all necessary, because once the player revisits the scene, new scripts will be loaded (as mentioned in meta's book).
Some sort of manual reloading mechanism would only be necessary for scripts that run all the time and never finish, such as game_loop.script. This also applies to inventory items scripts, because those are loaded when the game starts, so even if you supply new scripts in a patch package, they will never be automatically updated.

Big Thanks! It was a truly exhaustive explanation!
Logged
 

Page created in 0.081 seconds with 24 queries.