boring times - not enough memory
- Eleven Warrior
- Posts: 744
- Joined: Thu Apr 18, 2013 2:32 pm
- Location: Australia
Re: boring times - not enough memory
So how did you do it Minmay could you perhaps make a demo version dungeon just something simple it would help everyone a lot yeay:
Re: boring times - not enough memory
...I don't see how that would help at all? A champion's name is just a string of bytes, you can store any data in it. Just build your string of data, set a champion's name to it with Champion:setName(), and tell the user to save and import the party into a new game in the other dungeon(s). Then retrieve the string with Champion:getName(), unserialize it, and change the champion's name back (you would include the champion's original name in your data). You'd want to discard your reference to the string afterwards so that it gets garbage collected of course. And you have 4 strings to use for this if you really need to store a lot of data.
Of course this method is poor performance-wise (but in the case of a "multi-chapter" mod, it only has to run once per chapter) and can only store data that the scripting interface can access in the first place. You can't serialize the state of the game like actual saving.
It might be easier to write an external script that transfers the information you want from one save file to another. This is probably actually the easier option in the case of party inventory, since you get all components of the objects for all items the party is carrying, with guaranteed 100% correct state (provided their asset definitions are the same in both dungeons, at least, and provided that your script works correctly). And needless to say, both options are a pain in the ass from the player's perspective.
Of course this method is poor performance-wise (but in the case of a "multi-chapter" mod, it only has to run once per chapter) and can only store data that the scripting interface can access in the first place. You can't serialize the state of the game like actual saving.
It might be easier to write an external script that transfers the information you want from one save file to another. This is probably actually the easier option in the case of party inventory, since you get all components of the objects for all items the party is carrying, with guaranteed 100% correct state (provided their asset definitions are the same in both dungeons, at least, and provided that your script works correctly). And needless to say, both options are a pain in the ass from the player's perspective.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Re: boring times - not enough memory
I'm thinking about something else.
Lately I'm reading about modders who are building mods with 50, 100 or 150 levels. I am quite unsure if this is a good idea. Beside of technical limitations.
There are coming two imaginations into my mind, what kind of a mod as big as that could be:
- mods that are filled with stuff, puzzles and exciting areas as the main campaign is. I think then are 50 levels way too big. Who has the time to play that? And can a modder put a mainstory through all this or must this become a "finishing levels because there are levels" for players?
- or mods that are empty and whide to show a whole world. Something like WoW does. But then you have to make it not boring for players. Modders have to bring on stuff like NPCs or a multiplayer modus (??? probably impossible) or others to make open spaces interesting (and LoGII is not designated for things like that - would mean much work). Others could become fast a "traveling big distances because there are big distances" for players.
So I would like to know, why moders are interested in building huge mods and what kind of concept for playing they have in mind?
Lately I'm reading about modders who are building mods with 50, 100 or 150 levels. I am quite unsure if this is a good idea. Beside of technical limitations.
There are coming two imaginations into my mind, what kind of a mod as big as that could be:
- mods that are filled with stuff, puzzles and exciting areas as the main campaign is. I think then are 50 levels way too big. Who has the time to play that? And can a modder put a mainstory through all this or must this become a "finishing levels because there are levels" for players?
- or mods that are empty and whide to show a whole world. Something like WoW does. But then you have to make it not boring for players. Modders have to bring on stuff like NPCs or a multiplayer modus (??? probably impossible) or others to make open spaces interesting (and LoGII is not designated for things like that - would mean much work). Others could become fast a "traveling big distances because there are big distances" for players.
So I would like to know, why moders are interested in building huge mods and what kind of concept for playing they have in mind?
Re: boring times - not enough memory
That is what I was going to suggest, though I'd not tested it at all yet. I remember that it was a theory for LoG1. Is it the case that each champion's name can be 256 characters? And that the names can be parsed on load to restore the PC names ~and populate their inventory?minmay wrote:No.
However, you can abuse the party import feature to store arbitrary information. E.g. use Champion:setName() to encode all champions' inventories, game statistics, and whatever else you want to transfer, then have the player import the party into the next mod. I tested with a 1 MB name and it saved and loaded just fine, so there is plenty of space available. So if you want players to be able to go back and forth between two or more dungeons and have arbitrary persistence, it can be done. Whether this would actually be a good design is debatable, however.
*Would have to have a sanity check that ignores weird names unless they pass the test. Valid [data] names, could presumably pass along milestone event flags, inventory item names /charges, and state changes for NPCs that one might meet again... so they can maintain their previous attitudes towards the party.
Re: boring times - not enough memory
A good way to free up some memory is to not import standard_assets.lua which loads all LOG2 assets into memory. Instead import only the stuff you need in your mod. See standard_assets.lua in the asset pack.
Re: boring times - not enough memory
79813 objects as for now.kelly1111 wrote:@drakkan:
How many levels do you have?
How many objects?
I'm just curiuous as to what the limit is.
?
about 30 levels
200 mb size
I feel I am on the edge :d
Re: boring times - not enough memory
I tried this a few days ago, and dropped the memory usage by 50%.petri wrote:A good way to free up some memory is to not import standard_assets.lua which loads all LOG2 assets into memory. Instead import only the stuff you need in your mod. See standard_assets.lua in the asset pack.
(Crippling the game though, as that removed all but the dungeon title set.)
Re: boring times - not enough memory
Diarmuid did, in fact, succeed at storing party info in a name string in LoG 1. He was able to import it to a second dungeon, BUT. It was the most rudimentary information being carried. Name, exp, a couple of items. . . As minmay stated, in order to get any kind of persistent info across takes enormous amounts of coding and backdoorgery. What about charges in multiple objects? What if the mod created a keyring that gets some keys used and some not? Since it starts as an exploit, it would be very presumptuous to assume it can all be pulled off without hitting a wall somewhere. An external script solution would be incredible though.
Currently conspiring with many modders on the "Legends of the Northern Realms"project.
"You have been captured by a psychopathic diety who needs a new plaything to torture."
Hotel Hades
"You have been captured by a psychopathic diety who needs a new plaything to torture."
Hotel Hades
Re: boring times - not enough memory
some stats:
dat file size after export: 317mb
ingame objects: 14679
levels: 32
exported in low quality , but works and is playable in highest quality
Still wondering where the limit lies and what impacts the hardest ?
the number of game objects ?
dat file size after export: 317mb
ingame objects: 14679
levels: 32
exported in low quality , but works and is playable in highest quality
Still wondering where the limit lies and what impacts the hardest ?
the number of game objects ?
- Skuggasveinn
- Posts: 562
- Joined: Wed Sep 26, 2012 5:28 pm
Re: boring times - not enough memory
Is there a way for modders to access the performance profiler Petri talked about in this blog update http://www.grimrock.net/2014/03/07/perf ... mizations/ ?
would be nice to have a tool that digs deeper then process explorer, although I suspect in most cases its texture memory that's breaking the limit for people.
When people are making large mods, asset management becomes a key factor, going off to the Nexus and downloading assets like wallsets, weapon packs, and monsters etc, importing the packs and not excluding the things you don't use will stab you in the back down the road.
If you download a pack with 20 custom slime monsters just because you want the lava one and you leave the other 19 in there, that's a no no.
kind regards.
Skuggaveinn.
would be nice to have a tool that digs deeper then process explorer, although I suspect in most cases its texture memory that's breaking the limit for people.
When people are making large mods, asset management becomes a key factor, going off to the Nexus and downloading assets like wallsets, weapon packs, and monsters etc, importing the packs and not excluding the things you don't use will stab you in the back down the road.
If you download a pack with 20 custom slime monsters just because you want the lava one and you leave the other 19 in there, that's a no no.
kind regards.
Skuggaveinn.