ID:1284595
 
Resolved
Large projects, when recompiled after some changes, could confuse the compiler, requiring a completely new session of Dream Maker to work again.
BYOND Version:499
Operating System:Windows 7 Pro 64-bit
Web Browser:Chrome 27.0.1453.94
Applies to:Dream Maker
Status: Resolved (499.1197)

This issue has been resolved.
Descriptive Problem Summary:
After opening several files and making different code changes, attempting to compile the project source causes the compiler to freak out and do all kinds of freaky things "such as tell me that -4 isn't a number"

Numbered Steps to Reproduce Problem:
Open several code files (let's say like, 15)
Make changes in each code file
Compile
Should give you the problem right away
If it doesn't, open more things to take up more IDE memory (like some icons) or make a lot of code changes and Compile

Here's compiler's complaints for example:
loading Eternia.dme
loading interface.dmf
code\interface\menu\bag.dm:97:error: : expected a constant expression
code\interface\menu\bag.dm:114:error: : expected a constant expression
code\interface\menu\bag.dm:123:error: : expected a constant expression
code\interface\menu\crafting.dm:405:error: : expected a constant expression
code\interface\menu\crafting.dm:433:error: : expected a constant expression
code\interface\menu\party.dm:246:error: : expected a constant expression
code\interface\menu\party.dm:256:error: : expected a constant expression
code\social\guild.dm:134:error: : expected a constant expression
code\social\party.dm:389:error: : expected a constant expression
code\titlescreen\_title.dm:496:error: : expected a constant expression
code\titlescreen\_title.dm:501:error: : expected a constant expression
code\titlescreen\_title.dm:520:error: : expected a constant expression
code\map\obj\house.dm:151:error: : expected a constant expression
code\map\obj\house.dm:179:error: -16: bad number
code\map\props.dm:118:error: -8: bad number
code\map\obj\boat.dm:34:error: -2: bad number
code\map\obj\desert.dm:32:error: -4: bad number


Expected Results:
Eternia isn't even that big of a code base, and not a huge game, I would expect it to compile very easily. Its quite shocking that it has any trouble compiling.

Actual Results:
I often have to close and re-open dream maker many times before it will compile.

Does the problem occur:
Every time? Or how often? Very often
In other games? None of my own sources do this, but none of my own sources are this big yet
In other user accounts? n/a
On other computers? n/a

When does the problem NOT occur?
Re-opening Dream Maker and trying to compile. Sometimes it will take multiple attempts.

Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? This got better with 499 but is still a problem.

Workarounds:

There are none =(
I came across this while working on Eternia as well, but not as often as you seem to be having the problem. Closing DM and reopening it once resolves the problem for me for the remainder of my programming time.
This is happening due to some DM limits for the #object nodes that Eternia is exceeding. I am trying to fix this but it involves a lot of old assumptions.
Descriptive Problem Summary:
Programming\Character Screen.dm:17:error: -223: bad number
Programming\Character Screen.dm:12:error: 1e+007: bad number
Programming\Character Screen.dm:14:error: -224: bad number
Programming\HUD.dm:3:error: 2.14748e+009: bad number
Programming\Login Screen.dm:1352:error: 2.14748e+009: bad number
Programming\Login Screen.dm:1358:error: 2.14748e+009: bad number
Programming\mob-shooting.dm:250:error: -12: bad number
Programming\mob-shooting.dm:259:error: -16: bad number
Programming\Skills.dm:41:error: -50: bad number
Programming\Skills.dm:72:error: -50: bad number
Programming\Skills.dm:432:error: 2.14748e+009: bad number
Programming\Skills.dm:750:error: -4: bad number
Programming\Skills.dm:980:error: -50: bad number
Programming\Skills.dm:1025:error: -50: bad number
Programming\Skills.dm:1032:error: -120: bad number
Programming\Skills.dm:1033:error: -30: bad number
Programming\Skills.dm:11144:error: -12: bad number
Programming\Character Screen.dm:3:error: 1e+007: bad number
Programming\Character Screen.dm:5:error: -224: bad number
Programming\Pathing.dm:49:error: -64: bad number
Programming\Warps.dm:99:error: -16: bad number
Programming\Warps.dm:100:error: -10: bad number
Programming\Pathing.dm:29:error: -14: bad number
Numbered Steps to Reproduce Problem:
I honestly couldn't tell you. One moment the dream maker is working fine, everything compiles correctly, the next negative numbers are showing up as "bad numbers"
Code Snippet (if applicable) to Reproduce Problem:



x.pixel_x=-14 //for example


Expected Results:
To not get an error.
Actual Results:
I would say this error occurs probably 1 in every 30 compiles.

When does the problem NOT occur?
If I restart DM it works fine though a few minutes later it does the same thing.
Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? 498(Visit http://www.byond.com/download/build to download old versions for testing.)

Workarounds:
Restart DM.
In response to Dariuc
I'm seeing this on all negative numbers and decimals by pixel_x/y and layer.

Restarting DM clears it up.
In response to Kaiochao
I was doing that for a while, until a few minutes ago when my project crashed, so I thought I would make a post about it.
In response to Dariuc
This is the same error reported by FIREking. I believe it has to do with a change I made to increase the #usable paths, as I did find a problem there that I am trying to fix. Does your game have a huge number of items in the object tree?
In response to Tom
The errors I posted are from a game I code on /improve. And yes it takes upwards of 5 minutes just to generate the object tree.

In my game it takes about 30-45 seconds, though I have had this error with my game as well, only once though.
Lummox JR resolved issue with message:
Large projects, when recompiled after some changes, could confuse the compiler, requiring a completely new session of Dream Maker to work again.
The fix for this project is that internally, the compiler keeps IDs of the nodes it builds during the parsing and compiling process. Those nodes build up, and were wrapping around the old 2-byte limit. The build-up of those nodes hasn't changed, except that opening an environment will clear them, but now the wraparound is no longer an issue.

The fix for this goes hand in hand with better large-world support in BYOND 500. However the fix is available now, in 499.1197.
In response to Lummox JR
Are you suggesting compile-time limit for objects might be lifted in the near future?
That's awesome, thanks!
In response to FIREking
FIREking wrote:
Are you suggesting compile-time limit for objects might be lifted in the near future?

As of BYOND 500, compile-time strings, type paths, procs, and "map pops" will no longer be limited to 64K. Worlds that go beyond this limit will use a new 4-byte DMB format, which will also require the client to use 500+. Procs still maintain a 64K instruction limit.

Eternia comes nowhere near this limit BTW; its biggest item is the number of strings, which falls short of even 16K. I suspect it'd be very difficult for a world to hit these limits at all.
In response to Lummox JR
I would be interested in knowing what type of limits Epic:Legend is hitting. They are already doing something pretty funky with trees which I'm sure yutput would explain. I would consider his world a base-line for the lower end of "huge", and he's already having to do a lot of work just to have "trees".
Perhaps what I should do is output object counts at the end of compilation. I think users would find that instructive.
In response to Lummox JR
That would be both great for developers and you guys; we can help give you more stats and useful information without having to send projects back and forth.

Great idea.
In response to Lummox JR
Lummox JR wrote:
Perhaps what I should do is output object counts at the end of compilation. I think users would find that instructive.

I definitely asked you about this years ago!