# Worldgen Rewrite

**URL:** https://discourse.cataclysmdda.org/t/worldgen-rewrite/8934
**Category:** The Drawing Board
**Created:** [February 17, 2015, 5:43am UTC](https://discourse.cataclysmdda.org/t/worldgen-rewrite/8934 "2015-02-17T05:43:36Z")
**Posts on this page:** 20
**Page:** 2

<div class="post-metadata">

### Author: ![Angle](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/angle/32/957_2.png) [@Angle](https://discourse.cataclysmdda.org/u/Angle)
#### Post date: [February 18, 2015, 11:07pm UTC](https://discourse.cataclysmdda.org/t/worldgen-rewrite/8934/21 "2015-02-18T23:07:29Z")

</div>

Yeah, still pretty impressive though.

---

<div class="post-metadata">

### Author: ![Angle](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/angle/32/957_2.png) [@Angle](https://discourse.cataclysmdda.org/u/Angle)
#### Post date: [February 19, 2015, 3:08am UTC](https://discourse.cataclysmdda.org/t/worldgen-rewrite/8934/22 "2015-02-19T03:08:15Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![vache](https://avatars.discourse-cdn.com/v4/letter/v/ea666f/32.png) [@vache](https://discourse.cataclysmdda.org/u/vache)
#### Post date: [February 19, 2015, 3:57am UTC](https://discourse.cataclysmdda.org/t/worldgen-rewrite/8934/23 "2015-02-19T03:57:12Z")

</div>

Compile with debug on and gdb it for a stack trace?

---

<div class="post-metadata">

### Author: ![Coolthulhu](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/coolthulhu/32/2446_2.png) [@Coolthulhu](https://discourse.cataclysmdda.org/u/Coolthulhu)
#### Post date: [February 19, 2015, 4:05am UTC](https://discourse.cataclysmdda.org/t/worldgen-rewrite/8934/24 "2015-02-19T04:05:31Z")

</div>

> [@Angle](#):
>
> 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.

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.

---

<div class="post-metadata">

### Author: ![Angle](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/angle/32/957_2.png) [@Angle](https://discourse.cataclysmdda.org/u/Angle)
#### Post date: [February 19, 2015, 4:55am UTC](https://discourse.cataclysmdda.org/t/worldgen-rewrite/8934/25 "2015-02-19T04:55:39Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![Coolthulhu](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/coolthulhu/32/2446_2.png) [@Coolthulhu](https://discourse.cataclysmdda.org/u/Coolthulhu)
#### Post date: [February 19, 2015, 5:13am UTC](https://discourse.cataclysmdda.org/t/worldgen-rewrite/8934/26 "2015-02-19T05:13:31Z")

</div>

> [@Angle](#):
>
> 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?

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

---

<div class="post-metadata">

### Author: ![Angle](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/angle/32/957_2.png) [@Angle](https://discourse.cataclysmdda.org/u/Angle)
#### Post date: [February 19, 2015, 5:32am UTC](https://discourse.cataclysmdda.org/t/worldgen-rewrite/8934/27 "2015-02-19T05:32:35Z")

</div>

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](https://github.com/Angular-Angel/Cataclysm-DDA/blob/master/src/overmap.cpp).

---

<div class="post-metadata">

### Author: ![Coolthulhu](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/coolthulhu/32/2446_2.png) [@Coolthulhu](https://discourse.cataclysmdda.org/u/Coolthulhu)
#### Post date: [February 19, 2015, 6:22am UTC](https://discourse.cataclysmdda.org/t/worldgen-rewrite/8934/28 "2015-02-19T06:22:56Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Angle](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/angle/32/957_2.png) [@Angle](https://discourse.cataclysmdda.org/u/Angle)
#### Post date: [February 19, 2015, 6:28am UTC](https://discourse.cataclysmdda.org/t/worldgen-rewrite/8934/29 "2015-02-19T06:28:06Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Zireael](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/zireael/32/956_2.png) [@Zireael](https://discourse.cataclysmdda.org/u/Zireael)
#### Post date: [February 19, 2015, 12:34pm UTC](https://discourse.cataclysmdda.org/t/worldgen-rewrite/8934/30 "2015-02-19T12:34:13Z")

</div>

Great to see you solved the problem.

---

<div class="post-metadata">

### Author: ![KA101](https://avatars.discourse-cdn.com/v4/letter/k/278dde/32.png) [@KA101](https://discourse.cataclysmdda.org/u/KA101)
#### Post date: [February 20, 2015, 2:56am UTC](https://discourse.cataclysmdda.org/t/worldgen-rewrite/8934/31 "2015-02-20T02:56:50Z")

</div>

Nice. KA101 offers thumbs-up

---

<div class="post-metadata">

### Author: ![Angle](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/angle/32/957_2.png) [@Angle](https://discourse.cataclysmdda.org/u/Angle)
#### Post date: [February 20, 2015, 6:08am UTC](https://discourse.cataclysmdda.org/t/worldgen-rewrite/8934/32 "2015-02-20T06:08:50Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![kevin.granade](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/kevin.granade/32/1316_2.png) [@kevin.granade](https://discourse.cataclysmdda.org/u/kevin.granade)
#### Post date: [February 20, 2015, 6:13am UTC](https://discourse.cataclysmdda.org/t/worldgen-rewrite/8934/33 "2015-02-20T06:13:03Z")

</div>

ahahahaha you’re funny. Nobody is on any payroll here. We have some code bounties on bountysource, but that’s it.

---

<div class="post-metadata">

### Author: ![Angle](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/angle/32/957_2.png) [@Angle](https://discourse.cataclysmdda.org/u/Angle)
#### Post date: [February 20, 2015, 6:17am UTC](https://discourse.cataclysmdda.org/t/worldgen-rewrite/8934/34 "2015-02-20T06:17:50Z")

</div>

Ah. So the kickstarter came and went? Got it.

Well, it’s fun anyway.

---

<div class="post-metadata">

### Author: ![KA101](https://avatars.discourse-cdn.com/v4/letter/k/278dde/32.png) [@KA101](https://discourse.cataclysmdda.org/u/KA101)
#### Post date: [February 20, 2015, 6:56am UTC](https://discourse.cataclysmdda.org/t/worldgen-rewrite/8934/35 "2015-02-20T06:56:27Z")

</div>

[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.

---

<div class="post-metadata">

### Author: ![i2amroy](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/i2amroy/32/909_2.png) [@i2amroy](https://discourse.cataclysmdda.org/u/i2amroy)
#### Post date: [February 21, 2015, 1:20am UTC](https://discourse.cataclysmdda.org/t/worldgen-rewrite/8934/36 "2015-02-21T01:20:49Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![KA101](https://avatars.discourse-cdn.com/v4/letter/k/278dde/32.png) [@KA101](https://discourse.cataclysmdda.org/u/KA101)
#### Post date: [February 21, 2015, 1:25am UTC](https://discourse.cataclysmdda.org/t/worldgen-rewrite/8934/37 "2015-02-21T01:25:22Z")

</div>

Whales wasn’t paid either. Cataclysm is a labor of love.

---

<div class="post-metadata">

### Author: ![StopSignal](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/stopsignal/32/1923_2.png) [@StopSignal](https://discourse.cataclysmdda.org/u/StopSignal)
#### Post date: [February 21, 2015, 1:32am UTC](https://discourse.cataclysmdda.org/t/worldgen-rewrite/8934/38 "2015-02-21T01:32:41Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![vache](https://avatars.discourse-cdn.com/v4/letter/v/ea666f/32.png) [@vache](https://discourse.cataclysmdda.org/u/vache)
#### Post date: [February 21, 2015, 1:38am UTC](https://discourse.cataclysmdda.org/t/worldgen-rewrite/8934/39 "2015-02-21T01:38:58Z")

</div>

I don’t think there’s ever intended to be an end of development.

---

<div class="post-metadata">

### Author: ![Coolthulhu](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/coolthulhu/32/2446_2.png) [@Coolthulhu](https://discourse.cataclysmdda.org/u/Coolthulhu)
#### Post date: [February 21, 2015, 1:46am UTC](https://discourse.cataclysmdda.org/t/worldgen-rewrite/8934/40 "2015-02-21T01:46:33Z")

</div>

> [@vache](#):
>
> 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.

[Previous page](https://discourse.cataclysmdda.org/t/worldgen-rewrite/8934.md?page=1)

[Next page](https://discourse.cataclysmdda.org/t/worldgen-rewrite/8934.md?page=3)
