Duke4.net Forums: I did a test on CON file amount of code (not size) limits - Duke4.net Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

I did a test on CON file amount of code (not size) limits  "Concerning AMC TC due to large amount of coding"

User is offline   Zaxtor 

#1

Was running a test (out of curiosity)

Before I think I made a thread about limits of "gamevar VARNAME x x" and I think in newer Duke the gamevar limit was either increased greatly or has no limits.
Now this one is about amount of code limits (discovered)

If a CON file has a size limit (well not size in MB) but size in amount of codes such as gamevar VARNAME xx xx, events, spritepal xx, ifvare VARNAME xx, setsprite THISACTOR xxxx xxxx xxxx, ifcount xx, iffloordistl xx etc combined.
Actually it does have a limit.

Concerns me for AMC TC due to its very large code data size.
I know AMC TC will have several episodes and dunno how far is from the amount of code limit.

(splitting the confiles in several smaller one like AMC TC does NOT prevent that).

Exceeding (unknown amount of codes data limit) it will give you (v)


EDuke32 r7067
Built Oct 10 2018 14:07:44, GCC 7.2.0, 64-bit
Application parameters: -cachesize 65536 /eduke32 -map test.map /xCodelimittest.CON
Cache size: 65536kB
Warning: ignored application parameter "/eduke32".
Using CON file "Codelimittest.CON".
Using C:/$$ EDUKE32 HRP $$/DukeNeoP/ for game data
Checking for updates...
Connecting to http://www.eduke32.com
Current version is 20120522... no updates available
Running on Windows 10 (build 10.0.17134)
Initializing SDL 2.0.8
Searching for game data...
Using "duke3d.grp" as main game data file.
Compiling: Codelimittest.CON (5160788 bytes)
Codelimittest.CON: In actor `ORGANTIC':
Codelimittest.CON:6738: warning: found `else' with no `if'.
Codelimittest.CON: In state `pigshootenemystate':
Codelimittest.CON:8671: warning: found `else' with no `if'.
Including: CodeMore.CON (2470114 bytes)
Relocating compiled code from to 0x00000000209cd040 to 0x0000000021a43040
Relocating compiled code from to 0x0000000021a43040 to 0x0000000022a59040
Relocating compiled code from to 0x0000000022a59040 to 0x0000000024a65040




Conlimittest file has a copy of darktemple con but with many "extra functional codes" added on purpose to test.
include another con file to make more.
and is latest EDuke32 of Oct 10s 2018.
0

User is offline   Jblade 

#2

The CON size is dynamic, there's no real limit but there can be instances where the game will start to resize the CON limit (or whatever the technical term is) at a bad place which can cause crashes/issues which is where the scriptsize command comes in (but I don't think you've reached that limit) The only limit that could be a real problem is the sound limit of 4096, but there was talk of making that dynamic or something as well IIRC
0

User is offline   Zaxtor 

#3

con can be 10-20MB if it wants.

but if example you have let say

Actor NAME666

ifspritepal 1
{
ifvare HHHHH 0 { dosomething1 }
ifvare HHHHH 1 { dosomething2 }
ifvare HHHHH 2 { dosomething3 }
ifvare HHHHH 3 { dosomething6 }
ifvare HHHHH 4 { dosomething7 }
ifvare HHHHH 5 { dosomething7 }
*after many ifvares*
ifvare HHHHH 400 { dosomething400 }
}
ifspritepal 2
{
ifvare HHHHH 0 { dosomething slightly different1 }
ifvare HHHHH 1 { dosomething slightly different2 }
ifvare HHHHH 2 { dosomething slightly different3 }
ifvare HHHHH 3 { dosomething slightly different6 }
ifvare HHHHH 4 { dosomething slightly different7 }
ifvare HHHHH 5 { dosomething slightly different7 }
*after many ifvares*
ifvare HHHHH 400 { dosomething400 }
}

and you make several more like that.

you make lots of different codes.

you may hit the limit and get that

Relocating compiled code from to 0x00000000209cd040 to 0x0000000021a43040
Relocating compiled code from to 0x0000000021a43040 to 0x0000000022a59040
Relocating compiled code from to 0x0000000022a59040 to 0x0000000024a65040

error


I don't think is the size limits you can put inside an actor before the enda

but if you make several actor and you reach few codes before limits.

Then add 1 more actor example

actor DECO
enda

You hit 1 or 2 beyond the limit and get that complied error.

because actor DECO and enda counted as 2 codes

This post has been edited by Zaxtor: 22 October 2018 - 10:25 PM

0

User is offline   Jblade 

#4

it's not an error as I said, I had something like this and all I had to do was reposition code/utilise the scriptsize command (A whole bunch of the AMC code is text strings for the subtitles, conversations and interfaces)

Anyways, some little advice to save CON space if you're concerned about it - you don't need brackets if you're only doing a single thing (so if you're changing a sprite's palette you don't need to put { spritepal 2 } you can just put spritepal 2) Also you can use ife instead of ifvare which saves space AND is a lot quicker to type too.

This post has been edited by Jblade: 22 October 2018 - 10:41 PM

0

User is offline   Zaxtor 

#5

I see

Most of my codes uses "ifvare LOTAGSAVED 1" instead of making 100000 diff sprites

ifspritepal can be used too.

or I hybridize ifsprite pal and ifvare LOTAGSAVED 1


incase theres 2 ifvare LOTAGSAVED 1 that does different things.

I have some codes that goes as far as ifvare LOTAGSAVED 400-500s (for chopping blades) with game vars.

Example a pieces of a blade code (for a single piece)

ifvare LOTAGSAVED 281
{
ifvare CHOPBLADESCLOSING21 0 { setsprite THISACTOR -30239 34781 -80336 getactor[THISACTOR].sectnum temp getplayer[THISACTOR].cursectnum temp2 ifvarvare temp temp2 { ifpdistl 499 { addphealth -33 addphealth -33 addphealth -33 addphealth -33 } } }
ifvare CHOPBLADESCLOSING21 1 { setsprite THISACTOR -30239 34781 -78836 getactor[THISACTOR].sectnum temp getplayer[THISACTOR].cursectnum temp2 ifvarvare temp temp2 { ifpdistl 499 { addphealth -33 addphealth -33 addphealth -33 addphealth -33 } } }
ifvare CHOPBLADESCLOSING21 2 { setsprite THISACTOR -30239 34781 -77336 getactor[THISACTOR].sectnum temp getplayer[THISACTOR].cursectnum temp2 ifvarvare temp temp2 { ifpdistl 499 { addphealth -33 addphealth -33 addphealth -33 addphealth -33 } } }
ifvare CHOPBLADESCLOSING21 3 { setsprite THISACTOR -30239 34781 -75836 getactor[THISACTOR].sectnum temp getplayer[THISACTOR].cursectnum temp2 ifvarvare temp temp2 { ifpdistl 499 { addphealth -33 addphealth -33 addphealth -33 addphealth -33 } } }
ifvare CHOPBLADESCLOSING21 4 { setsprite THISACTOR -30239 34781 -74336 getactor[THISACTOR].sectnum temp getplayer[THISACTOR].cursectnum temp2 ifvarvare temp temp2 { ifpdistl 499 { addphealth -33 addphealth -33 addphealth -33 addphealth -33 } } }
ifvare CHOPBLADESCLOSING21 5 { setsprite THISACTOR -30239 34781 -72836 getactor[THISACTOR].sectnum temp getplayer[THISACTOR].cursectnum temp2 ifvarvare temp temp2 { ifpdistl 499 { addphealth -33 addphealth -33 addphealth -33 addphealth -33 } } }
ifvare CHOPBLADESCLOSING21 6 { setsprite THISACTOR -30239 34781 -71120 getactor[THISACTOR].sectnum temp getplayer[THISACTOR].cursectnum temp2 ifvarvare temp temp2 { ifpdistl 499 { addphealth -33 addphealth -33 addphealth -33 addphealth -33 } } }
}

Blades uses ifspritepal too.

Pal 110 (for upper blades)
Pal 100 (for lower blades)
pretty complex thing (wont post whole code will be too huge)



Blade I shown on a video.


My map will be finish long before I reach that threshold

This post has been edited by Zaxtor: 22 October 2018 - 11:04 PM

0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic


All copyrights and trademarks not owned by Voidpoint, LLC are the sole property of their respective owners. Play Ion Fury! ;) © Voidpoint, LLC

Enter your sign in name and password


Sign in options