Mythruna

Development => Blog => Topic started by: pspeed on August 20, 2012, 01:26:55 AM



Title: A day's worth of standing still...
Post by: pspeed on August 20, 2012, 01:26:55 AM
Spent nearly all day today heads-down coding to end up back where I was some time the previous night.  The game's internal infrastructure made great strides but it doesn't change the fact that it feels like treading water all day.  Also, the internal stuff still needs some work before it's in shape for the real engine... but it works ok in the AI prototype for now.

Lately, I find all kinds of reasons to bypass the normal terrain generation to get large sections of raw map data instead of the little chunks.  The random town stuff and road generation was kind of the last straw so I finally started incorporating this formally into the engine... which will reap a lot of benefits down the road.  The biggest plus is that it means I can generate these data files once and reuse them rather than doing the expensive calculation on the fly.

This is the same kind of data used to generate the classifier info in this pic: http://i.imgur.com/RAJMT.png

The other thing is that previously, the data was always from the raw fractal (and it still is) and so didn't have any of the gorges or cave systems in it.  Now that it's being more formalized, I can update this map-level data as the terrain is changed by that stuff... and by some user edits.

Half a dozen other planned features were sort of waiting for this data also... so in the long run it's "about time".


This came up now because when I went to bed last night, I was pretty sure that today I'd be starting to plot where towns should go... starting with the spawn point and spawn town.  The problem was, even to find the proper terrain-based spawn point, I needed to do several seconds worth of calculations.  I've been sort of living with these long pauses in the AI tester lately but it was starting to get ridiculous.  The layer in the image above did its calculations, spawn placement was going to have to do its calculation... it was time for proper support for map classification data.

So I did finally get this in.  It adds about 400k to each "node" (a 1024x1024 area) on disk... but given the ultimate utility of this information, that's small.


Later this evening, I did finally get to plotting the location of the spawn town.  This is the kind of trial-and-error coding that I generally obsess over.  If it took me 3 hours to get the color of fire right, you can guess how much time it takes to figure out why a town is placed in a location that seems wrong.  I had a lot of that.  Tweaking the algorithm, running the AI tester, scratching my head, looking at the data, and then finally copying it over to one of my Mythruna worlds to look at it in person.

Things always look different on the map.  In the 3D world, you have nice sight lines, etc... a few hours of tweaking and I mostly have the spawn town selection working pretty well.  The potential port sites is still a little weird.  It's technically correct now but I always end up having to go look at it in the world to confirm because it looks wrong on the map... and sometimes seeing what the computer saw as a good port site is a little tricky.  Fortunately, the computer will also be placing the docks someday.

As a debugging measure, at one point I ended up plotting all of the potential port sites for a good section of the map.  This view was nice and it's a relatively quick calculation... I may go ahead and store this information instead of recalculating it all the time.  This information would be useful even if there is no port there but an NPC ship for some reason wanted to go ashore.  The places that are good for ports are also good for reversibly beaching.

Anyway, I feel like things are starting to come together a little bit.  Hopefully this manifests in "something to show" soon.



Title: Re: A day's worth of standing still...
Post by: pspeed on August 20, 2012, 01:35:07 AM
For the curious, here is a picture showing where the engine chose to place the spawn point and the spawn town given the rules as I have them today:

http://i.imgur.com/FJNVm.png

(http://i.imgur.com/FJNVm.png)

I plotted some roads for testing.  The spawn connects to my original hand-built town and also to the spawn town location.  I also plotted a road to where the engine says is a good port site.  I even hand built a dock there in my Mythruna world to confirm it.


Title: Re: A day's worth of standing still...
Post by: FutureB on August 20, 2012, 02:41:41 AM
Paul that sounds pretty cool haha so the roads ect are spawning in game now? or just in the little testing bit.
good work when ever i read your blogs like this its as if the games coming along fast :P


Title: Re: A day's worth of standing still...
Post by: pspeed on August 20, 2012, 08:30:27 AM
Paul that sounds pretty cool haha so the roads ect are spawning in game now? or just in the little testing bit.
good work when ever i read your blogs like this its as if the games coming along fast :P

Only my AI tester thing will make the roads but then I can copy the world over to my Mythruna single player world and see what they look like.


Title: Re: A day's worth of standing still...
Post by: Moonkey on August 20, 2012, 09:24:09 PM
Paul that sounds pretty cool haha so the roads ect are spawning in game now? or just in the little testing bit.
good work when ever i read your blogs like this its as if the games coming along fast :P

Only my AI tester thing will make the roads but then I can copy the world over to my Mythruna single player world and see what they look like.

Next: The spawning and rotation of buildings. :) I bet If you posted what you did everyday, It would be like an everyday adventure ;). Love your work Paul. So I'm guessing the donators are getting something special soon? Hehe.

Edit: I can see you and FutureB are on :)


Title: Re: A day's worth of standing still...
Post by: pspeed on August 20, 2012, 09:28:18 PM
Paul that sounds pretty cool haha so the roads ect are spawning in game now? or just in the little testing bit.
good work when ever i read your blogs like this its as if the games coming along fast :P

Only my AI tester thing will make the roads but then I can copy the world over to my Mythruna single player world and see what they look like.

Next: The spawning and rotation of buildings. :) I bet If you posted what you did everyday, It would be like an everyday adventure ;). Love your work Paul. So I'm guessing the donators are getting something special soon? Hehe.

Edit: I can see you and FutureB are on :)

I hope so... I spent the afternoon tweaking my path/road carver.  Kind of a small waste of time at this point because the old roads were ok... but they were uninspiring.  Now I'm back to proper town layout.  I don't know if I'll get to putting real 3D buildings in tonight or not but hopefully I will have the general town laid out... I'm not yet randomizing the spawn town because I want to test all of the current building types for proper placement.  one step at a time.


Title: Re: A day's worth of standing still...
Post by: FutureB on August 20, 2012, 11:47:21 PM
Lol moonkey theres nothing me and paul where talking about in the donators section just to let you know, i just loged on earlier to check for any updates on this post :p


Title: Re: A day's worth of standing still...
Post by: ayoriceball on August 21, 2012, 12:41:26 AM
Paul that sounds pretty cool haha so the roads ect are spawning in game now? or just in the little testing bit.
good work when ever i read your blogs like this its as if the games coming along fast :P

Only my AI tester thing will make the roads but then I can copy the world over to my Mythruna single player world and see what they look like.

Next: The spawning and rotation of buildings. :) I bet If you posted what you did everyday, It would be like an everyday adventure ;).

That sounds like Toady One's blog for Dwarf Fortress. Not a bad idea.


Title: Re: A day's worth of standing still...
Post by: Moonkey on August 21, 2012, 11:40:38 PM
Paul that sounds pretty cool haha so the roads ect are spawning in game now? or just in the little testing bit.
good work when ever i read your blogs like this its as if the games coming along fast :P

Only my AI tester thing will make the roads but then I can copy the world over to my Mythruna single player world and see what they look like.

Next: The spawning and rotation of buildings. :) I bet If you posted what you did everyday, It would be like an everyday adventure ;).

That sounds like Toady One's blog for Dwarf Fortress. Not a bad idea.

"Day 1: I tried wrestling a man with my front left tooth In this random house." < What I do In Dwarf Fortess. :)


Title: Re: A day's worth of standing still...
Post by: ayoriceball on August 21, 2012, 11:55:04 PM
Paul that sounds pretty cool haha so the roads ect are spawning in game now? or just in the little testing bit.
good work when ever i read your blogs like this its as if the games coming along fast :P

Only my AI tester thing will make the roads but then I can copy the world over to my Mythruna single player world and see what they look like.

Next: The spawning and rotation of buildings. :) I bet If you posted what you did everyday, It would be like an everyday adventure ;).

That sounds like Toady One's blog for Dwarf Fortress. Not a bad idea.

"Day 1: I tried wrestling a man with my front left tooth In this random house." < What I do In Dwarf Fortess. :)

I hope you realize that it's a development blog :P


Title: Re: A day's worth of standing still...
Post by: pspeed on August 21, 2012, 11:58:00 PM
The town generator is coming along a bit.

Here is a picture of a potential farm that the generator carved out for me:
(http://i.imgur.com/nhgnq.jpg)

It comes from some data analysis like this:
(http://i.imgur.com/WOmN7.png)

That's a set of "flat" regions based on terrain.  The generator then uses the criteria that it needs a large-ish area to find the big areas and potentially merge some small nearby areas... ultimately it reduces it down to more likely useable candidates through some various forms of crunching:
(http://i.imgur.com/U0Wgz.png)

The top in-game screen shot was generated from a different town:
(http://i.imgur.com/t2yC1.png)

It's the large orange/red section in the bottom just left of middle.

Farms are the most extreme examples so I did them first.  It's easier to find smaller plots and most things will require relatively small plots of a specific size (8x8, 8x16, etc.).  Farms are unique in that they want potentially several regions and they don't care about the shape beyond filtering out the small-feature "noise".




Title: Re: A day's worth of standing still...
Post by: pspeed on August 22, 2012, 12:00:37 AM
P.S.: For those who know how to hack their world seed... I'm falling in love with seed 101.


Title: Re: A day's worth of standing still...
Post by: FutureB on August 22, 2012, 01:52:35 AM
Maybe in the donators section you could give us "simple minded" people a tutorial on changing seeds :P


Title: Re: A day's worth of standing still...
Post by: BigredRm on August 22, 2012, 08:38:20 AM
Thanks for the updates Paul.


Title: Re: A day's worth of standing still...
Post by: pspeed on August 22, 2012, 08:58:40 AM
Maybe in the donators section you could give us "simple minded" people a tutorial on changing seeds :P

I think I have mentioned it elsewhere but I couldn't easily find it on a search.  The easiest way is to run the stand alone server just to get the world created with a custom seed (because you can set it in the GUI) and then copy the mythruna.db directory over to a Mythruna client install.  (Make sure to remove or rename any existing mythruna.db directory.)


Title: Re: A day's worth of standing still...
Post by: pspeed on August 22, 2012, 09:12:45 AM
Maybe in the donators section you could give us "simple minded" people a tutorial on changing seeds :P

I think I have mentioned it elsewhere but I couldn't easily find it on a search.  The easiest way is to run the stand alone server just to get the world created with a custom seed (because you can set it in the GUI) and then copy the mythruna.db directory over to a Mythruna client install.  (Make sure to remove or rename any existing mythruna.db directory.)

You can also directly edit the world info file in the mythruna.db directory and then wipe out the node-* directories.  The above is the more straight-forward way, though.


Title: Re: A day's worth of standing still...
Post by: Moonkey on August 22, 2012, 08:35:18 PM
A good way to play single player with saved position would be to run the stand-alone server. :)


Title: Re: A day's worth of standing still...
Post by: pspeed on August 22, 2012, 09:37:55 PM
A good way to play single player with saved position would be to run the stand-alone server. :)

Yep. 

But to be clear, you don't have to play this way to customize the world seed.  Running the server once (and closing it) is enough to create the world-info file and initialize the world database.  Then as long as you play in the same directory or with that mythruna.db directory in your Mythruna.exe folder then you will get that world.


Title: Re: A day's worth of standing still...
Post by: pspeed on September 01, 2012, 11:09:04 PM
P.S.: For those who know how to hack their world seed... I'm falling in love with seed 101.

And world seed = 50 is one to keep an eye on too.  The spawn point starts on a pretty large continent where most of the land has a high elevation.  It may be just the roads that help but there were several "whoah" moments as I was following the road and suddenly came out cliff side looking way down over sprawling valleys.

A couple pics I snapped but they really don't do it justice:
(http://i.imgur.com/Mn2QL.jpg)
(http://i.imgur.com/iaFVj.jpg)


Title: Re: A day's worth of standing still...
Post by: Michael on September 02, 2012, 12:15:04 PM
P.S.: For those who know how to hack their world seed... I'm falling in love with seed 101.

And world seed = 50 is one to keep an eye on too.  The spawn point starts on a pretty large continent where most of the land has a high elevation.  It may be just the roads that help but there were several "whoah" moments as I was following the road and suddenly came out cliff side looking way down over sprawling valleys.

A couple pics I snapped but they really don't do it justice:
Code:
==some images

I am really psyched about those generated bridges, roads, ect. when will the update come for them?
and if they do come in updates, how to we "update" do we replace certain mythruna files? or does it do that for us?


Title: Re: A day's worth of standing still...
Post by: pspeed on September 02, 2012, 12:53:49 PM
P.S.: For those who know how to hack their world seed... I'm falling in love with seed 101.

And world seed = 50 is one to keep an eye on too.  The spawn point starts on a pretty large continent where most of the land has a high elevation.  It may be just the roads that help but there were several "whoah" moments as I was following the road and suddenly came out cliff side looking way down over sprawling valleys.

A couple pics I snapped but they really don't do it justice:
Code:
==some images

I am really psyched about those generated bridges, roads, ect. when will the update come for them?
and if they do come in updates, how to we "update" do we replace certain mythruna files? or does it do that for us?

The updates that include this won't be for a while.  It is still kind of in the prototype stage and I'm only just now massaging it into something that can go into the engine properly.

When the update comes, you will get a whole new client download.  Any new worlds you create in single player will automatically have the new stuff.  Any existing worlds will try to adapt but won't regenerate the parts that are already there.  My server will run into this issue, also.  Untouched parts of the world will have new hotness but much of the "near spawntown" world won't.