logo   login
right
Home Forums Downloads Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Forum Info
Forum Members: 18,537
Total Threads: 8,626
Posts: 94,205

Administrators:
DeeZire, Redemption

There are currently 129 users online.
Partner Links

Free Credit Repair

Learn the Ticket Broker Secrets
Advertisements


Red Alert 2 & Yuri's Revenge Editing Discuss any modding related issues to do with Red Alert 2 and Yuri's Revenge here.

Reply
 
LinkBack Thread Tools
Old 09-05-2005, 10:56 PM   #1 (permalink)
Senior Member
 
Join Date: Mar 2005
Location: Athens,Greece
Posts: 104
Default 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
TaloS is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-06-2005, 12:12 AM   #2 (permalink)
Senior Member
 
Join Date: Jul 2004
Posts: 448
Send a message via MSN to Death3464
Default

i havent really seen much difference, but if there is, it isnt that noticable.
Death3464 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-06-2005, 01:12 AM   #3 (permalink)
pd
Senior Member
 
Join Date: Sep 2003
Location: Datteln, Germany
Posts: 160
Send a message via ICQ to pd Send a message via MSN to pd
Default

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.
pd is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-06-2005, 06:12 AM   #4 (permalink)
Senior Member
 
Join Date: Dec 2002
Location: UK
Posts: 434
Default

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.
Marshall7a is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-06-2005, 07:07 AM   #5 (permalink)
Senior Member
 
AlliedG's Avatar
 
Join Date: Sep 2003
Location: U.K.
Posts: 726
Default

well it technically saves some kb as your not typing in Image=
AlliedG is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-06-2005, 08:08 AM   #6 (permalink)
Senior Member
 
Join Date: Jul 2003
Location: Lithuania, Central Europe
Posts: 1,047
Send a message via MSN to DCoder
Default

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.
DCoder is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-06-2005, 09:13 AM   #7 (permalink)
Senior Member
 
Join Date: Mar 2005
Location: Athens,Greece
Posts: 104
Default

That's exactly what i needed to know,I see Coding turns you on mate
TaloS is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-06-2005, 06:52 PM   #8 (permalink)
Senior Member
 
Join Date: Dec 2002
Location: USA
Posts: 756
Default

Quote:
Originally Posted by DCoder";p=&quot View Post
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...?
CannisRabidus is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-07-2005, 02:21 AM   #9 (permalink)
Senior Member
 
Join Date: Jul 2003
Location: Lithuania, Central Europe
Posts: 1,047
Send a message via MSN to DCoder
Default

From my understanding, yes, albeit very tiny. I do remember a note about an IE caused by HARV having an Image= defined, though.
DCoder is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-07-2005, 05:48 AM   #10 (permalink)
pd
Senior Member
 
Join Date: Sep 2003
Location: Datteln, Germany
Posts: 160
Send a message via ICQ to pd Send a message via MSN to pd
Default

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
pd is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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.


Design By: Miner Skinz.com
Powered by vBulletin® Version 3.7.0 Release Candidate 2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.