[RETIRED] Subversion Commit Log

For discussion of the code running behind the game

Moderator: Staff

User avatar
Roots
Dictator
Posts: 8665
Joined: Wed Jun 16, 2004 6:07 pm
Location: Austin TX
Contact:

Re: Subversion Commit Log

Postby Roots » Thu Jun 19, 2008 4:05 am

Commited revision: 1345

****************************************************
Modified files
M src/modes/map/map.h
M src/modes/map/map_tiles.h
M src/modes/map/map_objects.h
M src/modes/map/map.cpp
M src/modes/map/map_tiles.cpp
M dat/maps/demo_town.lua
M dat/config/settings.lua

Primary changes in commit
> Changed context data a little so that the current context is always equal to the context of the object pointed to by the map camera
> Added a second context to the map file for the town
> Added temporary debug code so we can switch the active map context via keyboard command (hit the swap key "a" to toggle the active context)

Notes
> Check out the map with the context toggle, its pretty cool! Right now the sprites not in the active context are still drawn so I'll have to remedy that, and there's no collision detection for the second context (you can walk through everything) so I have to see if that's missing data or if there's a problem in the collision code. After these steps are done and I fully implement context switching zones, map mode should be ready to go :approve:
****************************************************
Image
User avatar
Roots
Dictator
Posts: 8665
Joined: Wed Jun 16, 2004 6:07 pm
Location: Austin TX
Contact:

Re: Subversion Commit Log

Postby Roots » Sun Jun 22, 2008 2:28 am

Commited revision: 1348

****************************************************
Modified files
M src/modes/defs_modes.cpp
M src/modes/map/map_zones.h
M src/modes/map/map.h
M src/modes/map/map_objects.h
M src/modes/map/map_zones.cpp
M src/modes/map/map.cpp
M dat/maps/demo_town.lua


Primary changes in commit
> Map contexts are now fully supported in map mode. Go try walking into one of the houses in the town and see :)
> ContextZone class is now available

Secondary changes
> Removed temporary code for switching between contexts via the swap key
****************************************************
Image
User avatar
MindFlayer
Developer
Posts: 688
Joined: Fri Jan 06, 2006 12:55 pm
Location: Kuopio / Tampere, Finland
Contact:

Re: Subversion Commit Log

Postby MindFlayer » Sun Jun 22, 2008 7:54 am

1349 & 1350
****************************************************
Modified files
> grid.cpp
> battle.h
> battle.cpp

Primary changes in commit
> Just fixed some bugs I had noticed.

Bugs fixed
> Fixed editor crashing when loading the town map. This was caused by bad usage of C-style strings. Don't use them. EVER. :angry:
> Fixed another crash in the editor due to a bug in Qt 4.2 and/or Visual C++ 2005 (the problem occurred in QString::fromStdString() )
> Fixed a small memory leak in battle mode.

Miscellaneous notes
> no, not even then! stop thinking in C! :mad:
****************************************************
User avatar
gorzuate
Developer
Posts: 2575
Joined: Thu Jun 17, 2004 3:03 am
Location: Hermosa Beach, CA
Contact:

Re: Subversion Commit Log

Postby gorzuate » Sun Jun 22, 2008 11:24 pm

Rev. 1353 & 1354
****************************************************
Modified files
> grid.cpp
> demo_cave.lua
> demo_town.lua

Primary changes in commit
> Updated to reflect new change to map file syntax.
****************************************************

MindFlayer, the only reason you noticed that bug was because of a typo in an if-statement. Had the if-statement been correct from the get-go, you wouldn't have noticed the bug. Now, I do agree that if we can avoid C code and use C++ we should do so, however the stringstream fix you implemented must have been a mortal enemy of contexts, because I couldn't load any contexts with the stringstream fix. I didn't really have time to look into why it wasn't working, so for the time being I've reverted back to the buffer (with a fix to the if-statement).
Image
User avatar
MindFlayer
Developer
Posts: 688
Joined: Fri Jan 06, 2006 12:55 pm
Location: Kuopio / Tampere, Finland
Contact:

Re: Subversion Commit Log

Postby MindFlayer » Mon Jun 23, 2008 7:41 am

gorzuate wrote:MindFlayer, the only reason you noticed that bug was because of a typo in an if-statement. Had the if-statement been correct from the get-go, you wouldn't have noticed the bug. Now, I do agree that if we can avoid C code and use C++ we should do so, however the stringstream fix you implemented must have been a mortal enemy of contexts, because I couldn't load any contexts with the stringstream fix. I didn't really have time to look into why it wasn't working, so for the time being I've reverted back to the buffer (with a fix to the if-statement).

Actually that wasn't the only problem. It's crashing again. :uhoh: The another problem is that sprintf is going over the buffer's limits. You've set it to 10, when it should be at least 11, because of the terminating null character. And _that_, my friend is why we shouldn't use C strings at all. It's so easy to hack up things that might work by luck but crash on another machine. :) Could you try to see for one more time what was your problem with stringstreams and fix that instead? pretty please! :angel:
User avatar
gorzuate
Developer
Posts: 2575
Joined: Thu Jun 17, 2004 3:03 am
Location: Hermosa Beach, CA
Contact:

Re: Subversion Commit Log

Postby gorzuate » Mon Jun 23, 2008 5:38 pm

MindFlayer wrote:Could you try to see for one more time what was your problem with stringstreams and fix that instead? pretty please! :angel:


Sure :)
Image
User avatar
gorzuate
Developer
Posts: 2575
Joined: Thu Jun 17, 2004 3:03 am
Location: Hermosa Beach, CA
Contact:

Re: Subversion Commit Log

Postby gorzuate » Tue Jun 24, 2008 7:40 am

Rev. 1358 & 1359
****************************************************
Modified files
> grid.cpp
> demo_cave.lua
> demo_town.lua

Primary changes in commit
> Reverted back to old map file syntax.
****************************************************

I would like everyone to get back in the habit of posting their commits here, especially if they're related to the Make setup or the editor :angel: Thanks
Image
Winter Knight
Contributor
Posts: 304
Joined: Fri Sep 21, 2007 12:35 pm
Contact:

Re: Subversion Commit Log

Postby Winter Knight » Tue Jun 24, 2008 8:31 am

gorzuate, now that you've reverted the map format changes, the map editor can not load contexts anymore. It couldn't do it before the recent map format change either.

I noticed this when I was trying to fix the collision info for the mountain house interior tileset. I fixed the tileset (I think) and I was going to test it by loading demo_town in the editor, and then re-saving, which would use the new tileset collision info. Unfortunately, the editor can not read contexts.
User avatar
gorzuate
Developer
Posts: 2575
Joined: Thu Jun 17, 2004 3:03 am
Location: Hermosa Beach, CA
Contact:

Re: Subversion Commit Log

Postby gorzuate » Tue Jun 24, 2008 5:10 pm

It's probably related to the stringstream fix MindFlayer committed. Revert grid.cpp to the version just before MindFlayer's commit, and then contexts should work. I haven't figured out why it doesn't like stringstreams yet :huh:
Image
User avatar
MindFlayer
Developer
Posts: 688
Joined: Fri Jan 06, 2006 12:55 pm
Location: Kuopio / Tampere, Finland
Contact:

Re: Subversion Commit Log

Postby MindFlayer » Tue Jun 24, 2008 6:35 pm

gorzuate wrote:It's probably related to the stringstream fix MindFlayer committed. Revert grid.cpp to the version just before MindFlayer's commit, and then contexts should work. I haven't figured out why it doesn't like stringstreams yet :huh:

I thought you reverted my changes away. If that's the case, then the problem is still there and it wasn't stringstream's fault at all.
User avatar
gorzuate
Developer
Posts: 2575
Joined: Thu Jun 17, 2004 3:03 am
Location: Hermosa Beach, CA
Contact:

Re: Subversion Commit Log

Postby gorzuate » Tue Jun 24, 2008 9:06 pm

You committed the stringstream fix, then I tried it out and it didn't work, so at the same time that I changed the editor to use the newer map file syntax I put back in the char buffer code, and then when I reverted back to the older map file syntax, I just went back to the stringstream version.

Anyways, I'll try and look at it tonight to see what might be going on. So far it seems that char buffer doesn't work well on Windows, but works fine on Linux, but something with the stringstreams doesn't work on Linux. Can you try out the editor with the stringstream fix on Windows and see if you can view different contexts? All you have to do is open the demo_town map, and select the drop down menu for Contexts on the toolbar and choose the other context. (It's located in the house that has the shopkeeper next to it.)

I wonder what O/S Winter Knight is using.
Image
Winter Knight
Contributor
Posts: 304
Joined: Fri Sep 21, 2007 12:35 pm
Contact:

Re: Subversion Commit Log

Postby Winter Knight » Tue Jun 24, 2008 9:53 pm

I'm using Debian Testing Linux-i386. I tried what you suggested, and reverted grid.cpp to commit 1347, and then re-compiled. The editor behaves in the same manner. One of the other changes you made when you moved to the other map format was that you added context_names[1] = "Interior" to the map file. I tried re-adding this, and the editor added "Interior" to the drop down list. When I select it, the object layer disappears, but the houses don't change in appearance. This is the same behavior as when I add context_names[1] = ... and compile with the latest version of grid.cpp. Just for kicks, I tried reverting grid.cpp to revision 1349, which was MindFlayer's last commit to grid.cpp, and the editor has the same behavior.

I tried various other things, reverting to grid.cpp and demo_town.lua to various other commits, but nothing works. I don't recall the editor ever being able to load contexts, regardless of what MindFlayer, you, or even me or Roots have recently changed.
User avatar
gorzuate
Developer
Posts: 2575
Joined: Thu Jun 17, 2004 3:03 am
Location: Hermosa Beach, CA
Contact:

Re: Subversion Commit Log

Postby gorzuate » Wed Jun 25, 2008 5:41 am

Rev. 1361
****************************************************
Modified files
> grid.cpp
> demo_town.lua

Primary changes in commit
1. Slight fix to the demo_town to load contexts.
2. Banished stringstreams in favor of QString.
****************************************************

All fixed now :)

MindFlayer, do me a favor and print the resultant stringstream (from your version of the code, not the current one) and tell me what it prints. I was expecting it to print "context_01", but on my system it was printing "01ntext_". There's something buggy going on with stringstreams.
Image
User avatar
MindFlayer
Developer
Posts: 688
Joined: Fri Jan 06, 2006 12:55 pm
Location: Kuopio / Tampere, Finland
Contact:

Re: Subversion Commit Log

Postby MindFlayer » Wed Jun 25, 2008 6:13 am

1362
****************************************************
Modified files
> grid.cpp

Primary changes in commit
> I got rid of the QString because it crashes when converting it to a std::string (don't know what's the issue here!) and replaced it with stringstreams. I fixed the earlier issue with stringstreams and the contexts seem to be working alright now.

****************************************************
User avatar
gorzuate
Developer
Posts: 2575
Joined: Thu Jun 17, 2004 3:03 am
Location: Hermosa Beach, CA
Contact:

Re: Subversion Commit Log

Postby gorzuate » Wed Jun 25, 2008 7:34 am

Rev. 1363 & 1364
****************************************************
Modified files
> editor/grid.cpp
> modes/map/map_tiles.cpp

Primary changes in commit
> Updated map save function to use stringstreams as well.
> Game now uses consistent (with editor) context names when loading a map. (don't think it should seg fault any more, rujasu)
****************************************************
Image
Winter Knight
Contributor
Posts: 304
Joined: Fri Sep 21, 2007 12:35 pm
Contact:

Re: Subversion Commit Log

Postby Winter Knight » Thu Jun 26, 2008 1:01 pm

Revision 1365 and 1366
****************************


Modified files:
****************************

src/editor/tileset.cpp
dat/maps/demo_town.lua

Primary changes:

* Editor no longer crashes when trying to save a file. The problem was that tilesets were not being loaded properly, due to a missing read_data.CloseTable() call introduced in revision 1353.
* Reloaded demo_town.lua so that the changes in mountain_house_interior.lua would take effect. Collision detection in merchant house works now.
* Fine tuned context zone info in front of merchant house, so that it always opens when you approach the door, and will not remain open after you leave.

Misc:

Do we have a plan for opening doors? Right now, it's ugly. Also, NPCs can go through contexts. That's pretty cool. When I was walking around in the merchant's house, the quick little snot ran through the door and bumped into a bunch of walls and the furniture. When I left the house, it looked like the picture I've included.
Attachments
brat-walking-on-house.png
brat-walking-on-house.png (163.04 KiB) Viewed 3067 times
User avatar
Roots
Dictator
Posts: 8665
Joined: Wed Jun 16, 2004 6:07 pm
Location: Austin TX
Contact:

Re: Subversion Commit Log

Postby Roots » Thu Jun 26, 2008 10:18 pm

I think we may need some additional art to show the door opened inwards when inside the house. I'm not sure if we have anything right now to make it look any better than it does.

That's awesome that the NPC can switch contexts. I hadn't even tested that yet. Weird that the NPC was still showing when he wasn't in the active context though. I'll have to take a look at fixing that.
Image
Winter Knight
Contributor
Posts: 304
Joined: Fri Sep 21, 2007 12:35 pm
Contact:

Re: Subversion Commit Log

Postby Winter Knight » Fri Jun 27, 2008 4:43 am

Commited revision: 1367

****************************************************
Modified files:

dat/actors/characters.lua
dat/maps/demo_town.lua
dat/objects/arm_armor.lua
dat/objects/head_armor.lua
dat/objects/leg_armor.lua
dat/objects/torso_armor.lua
dat/objects/weapons.lua
src/global/defs_global.cpp
src/global/global.h
src/global/global_actors.h
src/main.cpp
src/modes/boot/boot.cpp
src/modes/boot/boot.h

Primary Changes:
* Removed CLAUDIUS and LAILA from the global engine code. Added a global.lua file, and put these constants in there. Starting info, such as starting drunes and items, is determined by global.lua:NewGame(), rather than by boot.cpp. Altered several lua files to use the new CLAUDIUS and LAILA constants, rather than GlobalManager...

Misc Notes:
* I asked about this here: viewtopic.php?f=17&t=440&p=24401#p24401 and received no objections, and Roots thought it was a good idea. I think it is a good addition before the release with the editor, because now it will be easier for users to start a game with their custom maps. They won't have to label them "demo_town", nor will they have to modify boot.cpp.

* I didn't do this, but the lua files would be easier to read if we replaced the "magic numbers" with constants defined in global.lua. For example, rather than "shop:AddObject(50502);", we can write "shop:AddObject(LEATHER_BOOTS);".
User avatar
Roots
Dictator
Posts: 8665
Joined: Wed Jun 16, 2004 6:07 pm
Location: Austin TX
Contact:

Re: Subversion Commit Log

Postby Roots » Sat Jun 28, 2008 7:09 pm

Winter Knight wrote:Commited revision: 1367



The entire game is broken from this commit. Did you test these changes? Here's the output I get:

Code: Select all


olsen@mai:~/dev/allacrost/sourceforge/demo$ ./allacrost -d all
INPUT: GameInput constructor invoked
SCRIPT: GameScript constructor invoked.
SETTINGS: GameSystem constructor invoked
MODE MANAGER: GameModeManager constructor invoked
GLOBAL: GameGlobal constructor invoked
SCRIPT ERROR: ReadScriptDescriptor::OpenFile() could not open the file dat/global.lua
cannot read dat/global.lua: No such file or directory
SCRIPT ERROR: ReadScriptDescriptor::OpenFile() could not open the file dat/objects/torso_armor.lua
dat/objects/torso_armor.lua:45: attempt to perform arithmetic on global `CLAUDIUS' (a nil value)
EXCEPTION:src/main.cpp:InitializeEngine:234: ERROR: unable to initialize GlobalManager
MODE MANAGER: GameModeManager destructor invoked
GLOBAL: GameGlobal destructor invoked
WARNING:src/engine/script/script_read.cpp:CloseTable:355: failed because there were no open tables to close
WARNING:src/engine/script/script_read.cpp:CloseTable:355: failed because there were no open tables to close
WARNING:src/engine/script/script_read.cpp:CloseTable:355: failed because there were no open tables to close
WARNING:src/engine/script/script_read.cpp:CloseTable:355: failed because there were no open tables to close
WARNING:src/engine/script/script_read.cpp:CloseFile:111: could not close the file because it was not open.
WARNING:src/engine/script/script_read.cpp:CloseFile:111: could not close the file because it was not open.
WARNING:src/engine/script/script_read.cpp:CloseFile:111: could not close the file because it was not open.
WARNING:src/engine/script/script_read.cpp:CloseFile:111: could not close the file because it was not open.
WARNING:src/engine/script/script_read.cpp:CloseFile:111: could not close the file because it was not open.
WARNING:src/engine/script/script_read.cpp:CloseFile:111: could not close the file because it was not open.
INPUT: GameInput destructor invoked
SCRIPT: GameScript destructor invoked.
SETTINGS: GameSystem destructor invoked
UTILS WARNING: Singleton::SingletonDestroy() was invoked when the class object was not instantiated
UTILS WARNING: Singleton::SingletonDestroy() was invoked when the class object was not instantiated
UTILS WARNING: Singleton::SingletonDestroy() was invoked when the class object was not instantiated


It looks like you forgot to add the global.lua file in your commit, so everyone with the most recent svn version can't budge until you add it. :eyebrow:
Image
Winter Knight
Contributor
Posts: 304
Joined: Fri Sep 21, 2007 12:35 pm
Contact:

Re: Subversion Commit Log

Postby Winter Knight » Sun Jun 29, 2008 2:20 am

Commited revision: 1369 (oops)

****************************************************
Modified files:

A dat/global.lua

Primary Changes:
* Added necessary file.

Misc Notes:
I started to test to make sure everything will work with a clean repository download. But I couldn't compile utils.cpp. I happened to upgrade my Debian Testing system this morning, so I thought maybe I removed something related to gettext. After investigating, it turns out that I upgraded g++ to 4.3. By using make CXX="g++-4.2", Allacrost will compile (actually, its compiling right now, but I'm pretty sure it will compile).

Allacrost does not work with g++-4.3. We need to fix that. I think it will be as simple as adding a header to utils.h, or utils.cpp.
Last edited by Winter Knight on Sun Jun 29, 2008 2:58 am, edited 1 time in total.

Return to “Programming”

Who is online

Users browsing this forum: No registered users and 4 guests