Hey, we have forums!

Author Topic: New crashing thread  (Read 22030 times)

0 Members and 1 Guest are viewing this topic.

Offline FrancesF

  • Bit Bit
  • ****
  • Posts: 83
    • View Profile
New crashing thread
« on: April 01, 2011, 06:30:11 am »
Wow!  Re-reading old modding threads, I just came across one that made no sense to me last month, but that I now realize could explain why I've been having random crashes to my mod.

Quote
It seems that after you kill a "white square entity" (white square in the entities list, created by players), the game becomes unstable and will randomly crash after that. That could also explain some crashes players had.

You can also try this : kill the entity, and press F2 in edit mode to save, the game will crash.

If you update the entities.txt file in the Aquaria directory (scripts/entities/entities.txt) to declare an id and graphic for the entity, the problem is solved.

The only thing is I don't like modifying the game's files when installing a mod, but I guess I won't have the choice.
Yododa, 2009


Since I now have about a dozen "white square" entities, some of whom are randomly killing each other, might this be why the screen suddenly turns black and freezes? (Although the music keeps playing.)  When it happens the map is dead; there is no way to access it again either from the editor or warping from another map; the game just freezes.  The first time I lost a significant amount of work, but now I back up the map files after every session.

Does anyone have any more information on this?


Offline Alphasoldier

  • Dream Bit
  • **********
  • Posts: 1810
  • Zero Suit!
    • View Profile
Re: New crashing thread
« Reply #1 on: April 01, 2011, 07:45:41 am »
Well you can always edit the XML files and remove the faulty entities by hand. Just search for their names.

Further than that I'd have no clue.
God sees and knows everything, but at least he won't gossip about it.

Offline FrancesF

  • Bit Bit
  • ****
  • Posts: 83
    • View Profile
Re: New crashing thread
« Reply #2 on: April 01, 2011, 04:22:01 pm »
I'm not sure the entities are faulty; so far they are modified from existing scripts.  Sometimes all I've changed is the graphic file and the name of the entity.  Maybe I should not save in the editor after one of them gets killed.  I had an area in the mod where Naija is trapped until she manipulates one entity into getting rid of another.  Guess I'll have to change that, or just use original entities from the game.

If I wanted to do what Yogoda suggested, and go into the entity file in the original game, how do I declare an id?

Offline Sindhi

  • Giant Bit
  • ******
  • Posts: 296
    • View Profile
    • Bindhu Artisan Jewelry
Re: New crashing thread
« Reply #3 on: April 01, 2011, 07:13:18 pm »
Send a PM to Yogoda; he is done running the Minecraft server as of today, ostensibly. I get white square tiles when the names don't match (graphics vs. tilesets); don't remember what causes white square entities, but Yogoda does.
"You are the sky. Everything else is just the weather."  Pema Chodron

Offline achurch

  • Bit Bit
  • ****
  • Posts: 90
    • View Profile
Re: New crashing thread
« Reply #4 on: April 02, 2011, 04:30:40 am »
White squares are caused when the default entity texture isn't found, and don't by themselves cause the game to crash -- there are actually a few such cases in the original data. The "default entity texture" is the texture listed in scripts/entities/entities.txt for entities which are listed there, and the name of the entity otherwise. Thus you can avoid white squares appearing by having a texture with the entity's name in your mod's graphics directory; you don't have to actually use this graphic for the entity (and you probably won't if it's an animated sprite).

As a side note, you don't need to modify the entities.txt file to use new entities. In fact, you probably shouldn't, because then your mod wouldn't work for any players who didn't make the same changes to their own entities.txt.

If you can find a way to consistently reproduce the crash, I'd be willing to take a look and see if I can isolate the bug -- send your mod to (mynick) at (mynick) dot org.

Offline Sindhi

  • Giant Bit
  • ******
  • Posts: 296
    • View Profile
    • Bindhu Artisan Jewelry
Re: New crashing thread
« Reply #5 on: April 02, 2011, 08:26:54 am »
What I know about scripting would fit in a thimble.  AChurch, please, what is a texture? I know what it is in art, but not in this context...
"You are the sky. Everything else is just the weather."  Pema Chodron

Offline achurch

  • Bit Bit
  • ****
  • Posts: 90
    • View Profile
Re: New crashing thread
« Reply #6 on: April 02, 2011, 08:33:38 am »
"Texture" is the term used in computer graphics to refer to a single image which is drawn on the screen, usually as part of a larger scene. Originally, the term referred specifically to images used in 3D texture mapping (that is, "wrapping" an image onto a flat surface to give the illusion of texture to the surface). These days, though, 3D libraries like OpenGL are used even for 2D graphics, as in Aquaria, so "texture" has come to mean any individual graphic used in creating a scene.

In other words, replace "texture" with "image" and it'll mean pretty much the same thing. (:

Offline achurch

  • Bit Bit
  • ****
  • Posts: 90
    • View Profile
Re: New crashing thread
« Reply #7 on: April 02, 2011, 08:05:38 pm »
It turns out the game will indeed crash if you have a custom entity (one not listed in entities.txt) which has been killed and you try to save the map. To avoid this, you'll need to either: (1) add your entities to entities.txt with unique ID numbers, with the drawback mentioned earlier that users will have to make the same changes to their own copies of entities.txt; or (2) make sure you don't save in the scene editor when there's any chance a custom entity may have been killed (this includes autosave, which can potentially strike at any time).

In theory, you could edit the map XML files to replace your custom entity IDs with entity names, to avoid the drawback associated with the entities.txt method. You'd need to parse the j="" attribute of the <Entities> tag, and replace each occurrence of your custom entity's ID (e.g. "1234") with a -1 and the entity name (e.g. "-1 MyEntity"). If you do this, be careful you don't accidentally change other entity data which just happens to have the same value as the entity ID!

Shameless self-promotion: While this requires a bit of technical knowledge, you could also compile my modified source code, to which I've just committed a fix for this bug. Unfortunately, there are incompatibilities in the script interface that prevent scripts written for the Humble Bundle (1.1.3) and earlier releases from working on the modified source code, and vice versa; see this mailing list post for more information. Alternatively, you can build from the "custom-entity-crash-fix" branch to get just this fix and remain compatible with the original script interface.

Offline False.Genesis

  • Administrator
  • Super Bit
  • **********
  • Posts: 461
  • PRESS COMPILE FOR RAINBOWS
    • View Profile
    • My source code!
Re: New crashing thread
« Reply #8 on: April 03, 2011, 02:03:42 am »
achurch, just out of interest:  do you think it would be a good idea to release a 1.1.4-community patch somewhere in future (based on your repo, by chance) ?
That would help many people that still have the 1.1.1 version by plimus, or those who create mods (an example here is that original game files have to be modified for certain mods to work, as you said, so giving mods more power over the game and game data would be a good thing to do -- I already have plans for that, but no time to integrate it, for now)
ofc having it compatible with existing mods is the biggest problem... something to deal with later, i guess.

Offline achurch

  • Bit Bit
  • ****
  • Posts: 90
    • View Profile
Re: New crashing thread
« Reply #9 on: April 03, 2011, 04:49:13 am »
GMMan has already built Windows binaries from both the Icculus and my repositories. I'm currently focusing on the iPad version, but when I have a chance I'll look into adding Mac and Linux binaries as well.

Due to the extent of changes to the script engine, I don't know whether it'll be possible to maintain bidirectional compatibility, though there may be a way to get scripts from 1.1.3 and earlier to work with the new binary. I'll give it some thought.

Offline False.Genesis

  • Administrator
  • Super Bit
  • **********
  • Posts: 461
  • PRESS COMPILE FOR RAINBOWS
    • View Profile
    • My source code!
Re: New crashing thread
« Reply #10 on: April 03, 2011, 05:01:47 pm »
ofc a compatibiliy mode would be nice, but that would probably require individual tuning for each script file, in case mods with old scripts load new scripts shipped with the game.

imho a better solution (although a pain in the ass) would be to convert existing scripts for mods  (there aren't many mods anyways).
when i have some time this summer (july) i could have a go at this, so this issue can be resolved once and for all without too many compatibility problems. not that i know much about lua by now, but its just another programming language, easy to learn basics in a day, and advanced things within 3 :)

I can also build bins for 32 and 64 bit linux, and 32 bit windows (visual studio - in my fork on github i finetune things especially for MSVC, but keeping compatibility with linux of course). So, keep your focus on the iPad version :)

Offline FrancesF

  • Bit Bit
  • ****
  • Posts: 83
    • View Profile
Re: New crashing thread
« Reply #11 on: April 03, 2011, 06:56:33 pm »
Dear achurch,

You wrote a patch!  That is so great!  Could you explain (as if to your computer literate, but non-programming, grandmother) exactly what I have to do step-by-step to integrate those patches (I just looked them up on Mercurial) into the game on my Mac?

Thank you so much,
FrancesF

Offline GMMan

  • Giant Bit
  • ******
  • Posts: 254
  • "Uh... I'll be right here after you're done..."
    • View Profile
Re: New crashing thread
« Reply #12 on: April 03, 2011, 08:17:19 pm »
I haven't developed on Mac , but I can name the prerequsites...
You'll need a copy of Mercurial, CMake, and a C++ compiler package (Xcode is the one from Apple). The other dependencies are included in the Mercurial repo.

Generic compiling instructions:
When you've installed all that, open up a Terminal (it's in a subfolder in the Apps folder), 'cd' to a directory that you will put all of Aquaria's source into, and run:
Code: [Select]
hg clone http://www.achurch.org/cgi-bin/hg/aquaria
Wait for the source to download, and then configure the source by running:
Code: [Select]
cmake CMakeLists.txt
and then, to build:
Code: [Select]
make
Check this page (Linux instructions): http://www.bit-blot.com/forum/index.php?topic=2304.msg28396#msg28396

Remember to copy the scripts included with the source or else your build won't run correctly.
Follow me on Twitter: @gmman_bzflag

Offline Sindhi

  • Giant Bit
  • ******
  • Posts: 296
    • View Profile
    • Bindhu Artisan Jewelry
Re: New crashing thread
« Reply #13 on: April 03, 2011, 08:18:40 pm »
Thank you!
"You are the sky. Everything else is just the weather."  Pema Chodron

Offline FrancesF

  • Bit Bit
  • ****
  • Posts: 83
    • View Profile
Re: New crashing thread
« Reply #14 on: April 03, 2011, 09:47:05 pm »
Thanks, GMMan, I will try all that.

Frances