 |
Forum Info
|
 |
Forum Members: 18,537
Total Threads: 8,626
Posts: 94,205
Administrators:
DeeZire, Redemption
There are currently 129 users online.
|
 |
Partner Links
|
 |
 |
Advertisements
|
 |
|
| Red Alert 2 & Yuri's Revenge Editing Discuss any modding related issues to do with Red Alert 2 and Yuri's Revenge here. |
09-05-2005, 10:56 PM
|
#1 (permalink)
|
|
Senior Member
Join Date: Mar 2005
Location: Athens,Greece
Posts: 104
|
INI optimization question
Does using the same entry name for a unit in both the rulesmd and the artmd(rather that using the image= tag) as well as using a vxl that corresponds to that entry,optimize the game in terms of speed?
Wether you can answer from personnal experience or coding knowledge it will do. Thanks in advance
|
|
|
09-06-2005, 12:12 AM
|
#2 (permalink)
|
|
Senior Member
Join Date: Jul 2004
Posts: 448
|
i havent really seen much difference, but if there is, it isnt that noticable.
|
|
|
09-06-2005, 01:12 AM
|
#3 (permalink)
|
|
Senior Member
Join Date: Sep 2003
Location: Datteln, Germany
Posts: 160
|
Errr... no.
The game always uses the Image tag, it's default to the unit ID declared in the lists.
From the Image tag, it gets the art section to use and the filename using the makepath API, which's speed is always the same.
|
|
|
09-06-2005, 06:12 AM
|
#4 (permalink)
|
|
Senior Member
Join Date: Dec 2002
Location: UK
Posts: 434
|
Presumably, one has to be slightly faster, as:
If UnitID.Image != <empty string>
Then GetArtwork(UnitID.Image)
Else GetArtwork(UnitID)
In which case, using Image= would be more efficient (by a few instructions)
Or the other way around.
Maybe not worth the hassle, but one still has to be more efficient than the other, even if it is only by one instruction.
|
|
|
09-06-2005, 07:07 AM
|
#5 (permalink)
|
|
Senior Member
Join Date: Sep 2003
Location: U.K.
Posts: 726
|
well it technically saves some kb as your not typing in Image=
|
|
|
09-06-2005, 08:08 AM
|
#6 (permalink)
|
|
Senior Member
Join Date: Jul 2003
Location: Lithuania, Central Europe
Posts: 1,047
|
Actually, Marshall, according to Pd's docs Image= flag value is calculated at parsing time, like this:
object.Image = object.Image == '' ? Object.ID : Object.Image;
Object.ID is (I assume) the first element in the data structure holding this object.
Object.Image is stored at offset 0x24.
That converts to asm (loose translation) like
<read Image into the 0x24 offset>
<compare that string at 0x24 offset to an empty str>
jne DEFINED_IMAGE; jump straight to label DEFINED_IMAGE if it is not an empty string
mov $object_storage_start_point+0x24 , $object_storage_start_point+0 ; copy data from ID field into Image field
DONE_LOADING_IMAGE:
<continued code>
as you see, in case you omit Image=, the game wastes some cycles to move the data and calculate the source/target offsets (unless they used static memory allocation, which, while not advisable and not likely, would explain the 102 unit bug - they could have statically allocated memory for 101 data structure, and the later ones override something else). However, a waste of a few cycles on machines that can do over 1E9 (Pentium III 1GHz) cycles per second, is negligible. Not to mention, unavoidable.
|
|
|
09-06-2005, 09:13 AM
|
#7 (permalink)
|
|
Senior Member
Join Date: Mar 2005
Location: Athens,Greece
Posts: 104
|
That's exactly what i needed to know,I see Coding turns you on mate 
|
|
|
09-06-2005, 06:52 PM
|
#8 (permalink)
|
|
Senior Member
Join Date: Dec 2002
Location: USA
Posts: 756
|
Quote:
Originally Posted by DCoder";p="
Actually, Marshall, according to Pd's docs Image= flag value is calculated at parsing time, like this:
[snip]
|
In short, what you're saying is that with no Image= tags, the game will take some tiny amount of time longer to load initially, but while playing the game, there is no effect...?
|
|
|
09-07-2005, 02:21 AM
|
#9 (permalink)
|
|
Senior Member
Join Date: Jul 2003
Location: Lithuania, Central Europe
Posts: 1,047
|
From my understanding, yes, albeit very tiny. I do remember a note about an IE caused by HARV having an Image= defined, though.
|
|
|
09-07-2005, 05:48 AM
|
#10 (permalink)
|
|
Senior Member
Join Date: Sep 2003
Location: Datteln, Germany
Posts: 160
|
ingame, there's no speed effect at all.
it loads the voxel data / shp data when you see the loading screen (well, that's it purpose).
in the game, it doesn't matter what tag has been loaded or what filename used or whatever
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
Similar Threads
|
| Thread |
Thread Starter |
Forum |
Replies |
Last Post |
|
Zero Hour and Optimization
|
Rodman49 |
Generals & Zero Hour Editing |
27 |
10-04-2003 06:28 AM |
All times are GMT -4. The time now is 01:31 PM.
|