Yeah, still pretty impressive though.
welp, I finished the first part, and it compiles, but when I try to create a new character in a new world it crashes and all it tells me is “Segmentation fault; core dumped; real time: 18s; user: 60ms; system: 5s”. Does anyone know how to get proper information out of the thing? I tried to run it with dbg but that failed too. I’m using netbeans on xubuntu, if that means anything to you.
Compile with debug on and gdb it for a stack trace?
Are you making the debug build or release one? The release build strips all the symbols, so debugging won’t do much with release builds.
By “dbg”, I presume you mean “gdb”. What do you mean by “that failed too”? It didn’t output any stacktrace?
Try from console maybe. Running a debug build with gdb attached till it crashes should be enough.
I tried using the builtin gdb from netbeans, and it refused to start. It gives me “Error opening terminal: unknown.”. running gdb from the command lie works, though.
I hadn’t compiled it with the debug stuff in, mainly because I hadn’t realized that was a thing. I’m not entirely sure how to do that, either. I’m really used to my IDE doing most of that stuff for me, if you can’t tell. <__<. I was able to find it in the makefile, but I’m not sure how to configure the IDE to run that build. As is, the IDE uses the makefile, and it might already be using the debug build - I don’t think the release def was set. its using the -g -D_GLIBCXX_DEBUG options when it compiles the various files. does that mean it’s using the debug build, or do I need to do something else? Am I supposed to just edit the makefile? Like uncomment:
# Disable debug. Comment this out to get logging.
#DEFINES = -DENABLE_LOGGING
or something?
Then it’s probably a debug build, no need to touch Makefile. Release would have -DRELEASE and no -g.
You can use the binary you built with gdb.
As far as I know, just opening terminal, running gdb cataclysm
and then run
in gdb console should be enough. It should start the game (game is very slow in debug build, so have patience), then you can reproduce the crash. After that, backtrace
in gdb console should print the entire stack
well, I got it open in the debugger. I got it going with “Start” not “Run”, because I hadn’t read your post yet, but it seemed to go fine anyway. It wasn’t slow at all, so I’m not sure it was in debug mode? I got to the cash though, and it’s a little strange:
#0 0x000000000058d745 in __gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator<oter_id const*, std::__cxx1998::vector<oter_id, std::allocator<oter_id> > >, std::__debug::vector<oter_id, std::allocator<oter_id> > >::_Safe_iterator (
this=0x7fffff7ff2c0, __i=..., __seq=0x7fffff7ff410)
at /usr/include/c++/4.8/debug/safe_iterator.h:152
#1 0x000000000058c57b in std::__debug::vector<oter_id, std::allocator<oter_id> >::begin (this=0x7fffff7ff410) at /usr/include/c++/4.8/debug/vector:221
#2 0x0000000000c32a51 in road_allowed (tile=...) at src/overmap.cpp:222
#3 0x0000000000c32aa3 in road_allowed (tile=...) at src/overmap.cpp:223
#4 0x0000000000c32aa3 in road_allowed (tile=...) at src/overmap.cpp:223
#5 0x0000000000c32aa3 in road_allowed (tile=...) at src/overmap.cpp:223
#6 0x0000000000c32aa3 in road_allowed (tile=...) at src/overmap.cpp:223
#7 0x0000000000c32aa3 in road_allowed (tile=...) at src/overmap.cpp:223
#8 0x0000000000c32aa3 in road_allowed (tile=...) at src/overmap.cpp:223
#9 0x0000000000c32aa3 in road_allowed (tile=...) at src/overmap.cpp:223
#10 0x0000000000c32aa3 in road_allowed (tile=...) at src/overmap.cpp:223
#11 0x0000000000c32aa3 in road_allowed (tile=...) at src/overmap.cpp:223
#12 0x0000000000c32aa3 in road_allowed (tile=...) at src/overmap.cpp:223
#13 0x0000000000c32aa3 in road_allowed (tile=...) at src/overmap.cpp:223
#14 0x0000000000c32aa3 in road_allowed (tile=...) at src/overmap.cpp:223
#15 0x0000000000c32aa3 in road_allowed (tile=...) at src/overmap.cpp:223
#16 0x0000000000c32aa3 in road_allowed (tile=...) at src/overmap.cpp:223
#17 0x0000000000c32aa3 in road_allowed (tile=...) at src/overmap.cpp:223
---Type <return> to continue, or q <return> to quit---`C'`C'
It seems it doesn’t like “for (const oter_id &ter : tile.tiles)” where tile.tiles is “std::vector<oter_id> tiles;” nor the line afterward where I actually reference that ter variable. It’s weird, though, cause I had another function that does basically the same thing right above this, and that one went through fine. You can see the functions it’s complaining about here.
I spent 10 minutes trying to understand why would road_allowed call itself instead of the other overload.
Do you declare road_allowed in some sort of header? It isn’t declared in overmap.cpp.
The only explanation for what is happening I can think of right now would be that first road_allowed (the overload you call on complex_map_tile) doesn’t know of any other road_allowed, so it invokes self recursively instead, either casting oter_id& to complex_map_tile& or constructing new complex_map_tile and using that.
That actually might be what’s happening. I didn’t declare it anywhere else as it’s only used in that one file. I was convinced that the problem was in how I was using vectors, but you’re probably right. The codes compiling now, so let’s see…
Yeah, that was it. Nice catch.
Great to see you solved the problem.
Nice. KA101 offers thumbs-up
Thanks! I’m working on saving/loading right now. Come to think of it, I was considering looking to see if you’d take me on as a permanent developer - complete with paycheck. Is that a thing right now, or are you already full up?
ahahahaha you’re funny. Nobody is on any payroll here. We have some code bounties on bountysource, but that’s it.
Ah. So the kickstarter came and went? Got it.
Well, it’s fun anyway.
[quote=“Angle, post:34, topic:8934”]Ah. So the kickstarter came and went? Got it.
Well, it’s fun anyway.[/quote]
Yep, the bounties are what remains of the kickstarter.
Even during the kickstarter there was literally only one person on payroll, GalenEvil, and that’s because that was the intended point of the Kickstarter. C:DDA has been a purely volunteer basis for it’s whole life AFAIK.
Whales wasn’t paid either. Cataclysm is a labor of love.
You guys should get a patreon until the development ends. That’d be pretty cool. Or it would be really bad. I don’t know.
I don’t think there’s ever intended to be an end of development.
We Dwarf Fortress now
Actually, DDA is getting quite DF-y now that I think about it.