When you or your opponent jumps to tech level 2, there is a sudden jolt of the screen as the game suddenly lags for a second. I imagine this is caused by cacheing a bunch of new buildpics and unit-whatevers for all the new stuff that's now buildable. This doesn't only happen when a factory is built, but also when a construction unit is built which hasn't been built before. That last bit is important - it only happens the first time each player builds their tech level 2 lab, or tech level 2 constructor, or tech level 3 gantry, and so on. Even just level 1 construction units/factories do this.
Anyway, if you get it down to a science, it's probably quite easy to ascertain "where" your opponent is, tech-level speaking, but counting the number of jolts you experience. This is especially true in 1v1 games, where there is only one other possible person who might be jumping tech. Furthermore, it completely ruins the surprise factor that the first L2 units entering a battlefield can have.
This needs to be fixed very badly. I don't know how this sort of thing is handled by the engine, but it seems that it only caches data as it needs to, which makes sense, but if it is so easily detected as happening, it's a game-breaker.
Screen jolt at tech jump
Moderator: Moderators
yes
Yes, you're right about that, there are two things happening:
1)When someone builds any unit that hasn't been build before the screen kind of blinks for a moment.(but no noticable spike in activity with "b" debug view)
2)When a new unit is created there's a big spike in activity and maybe a little pause, but no screen blinking.
It would be nice to optimize the functions happening at 2) and also if it wouldn't take too much memory it would be ok to load all unit definitions in the beginning to eliminate 1) but all those things are pretty minor compared to other things that need to be done.
1)When someone builds any unit that hasn't been build before the screen kind of blinks for a moment.(but no noticable spike in activity with "b" debug view)
2)When a new unit is created there's a big spike in activity and maybe a little pause, but no screen blinking.
It would be nice to optimize the functions happening at 2) and also if it wouldn't take too much memory it would be ok to load all unit definitions in the beginning to eliminate 1) but all those things are pretty minor compared to other things that need to be done.
but prolly when you build a plant the unitdefs from the units the plant can build are then dinamicly loaded (they are not all loaded at startup, only loaded when needed)AF wrote:I wodner where all this stuff about loading build menus came from, from what i see in the UnitDef* structures that all this data is held in, the unit build menus are stored as a map<int,std::string> pair, and are loaded at gamestartup, so they're not causing the slowdowns.......
that isnt true either, the unitdef's are stored as an array UnitDef** by the engine, when the AI asks for one of these data structures providing a unit name or the id of that unit type the action done by the callback interface is equivilant to return unitdefs[unitid_thataiaskedfor], it isnt dynamically loaded, it's all loaded at startup when the unit is laoded and the game has yet to start, along with all the models and the map and pathfinding is calculated/loaded.
That and I do not believe that loading that data structure would causes the slowdowns that I've experienced in the past, maybe if it where loading 100+ units at once
That and I do not believe that loading that data structure would causes the slowdowns that I've experienced in the past, maybe if it where loading 100+ units at once
- Guessmyname
- Posts: 3301
- Joined: 28 Apr 2005, 21:07
When a unit is built, all the info for the units it can build is loaded upon the beginning of its construction. in CZTA, several units have bad/incorrect MoveCategories (mainly because I can't be bothered changing them), but the console warnings for this only appear upon their respective factories construction
you are wrong and zaphod told me so in the past.AF wrote:that isnt true either, the unitdef's are stored as an array UnitDef** by the engine, when the AI asks for one of these data structures providing a unit name or the id of that unit type the action done by the callback interface is equivilant to return unitdefs[unitid_thataiaskedfor], it isnt dynamically loaded, it's all loaded at startup when the unit is laoded and the game has yet to start, along with all the models and the map and pathfinding is calculated/loaded.
That and I do not believe that loading that data structure would causes the slowdowns that I've experienced in the past, maybe if it where loading 100+ units at once
Thats why loading the all the unitdef table at the start of my ai gives me an extra 10 seconds wait or so (in mods with a lot a units its even more!).
Because it only loads them when it needs them (goes to the fbi file a reads them and so).