Tales from the TinkerShed

Ok Folks, I’m getting too far spread with all those message threads, so I thought I create my own thread where I publish the latest and greatest tinker explorations :slight_smile:

PLEASE post only comments related to the subject, my shed is a mess as it is already :stuck_out_tongue:

1 Like

BIOME MAP GENERATOR … first draft.
I managed to twist Flowlab’s arms enough to get it to do at least partially what I want. Here the first preview of the Biome Generator:
screenshot1
Link: BIOME MAP


For background info and some of the details please refer to this thread: a-randomly-generated-world At this stage I placed the seeds manually, it is a testing ground to see if the routine itself works. Also, I use a timer in the scanning routine, that's why it goes 'Slow-Mo'. The idea is not mine, the inspiration comes from this reference: stackoverflow.com/2d-tile-map-generation-with-biomes Watch this space for updates :)

I am now quite happy with the scanner routine itself. I laid it out in a way that it is easy to modify and extend. Further easy to implement extensions will be ‘wrap around’ mode for the map and a second method of scanning it.
At the moment it uses the Euclidean Distance routine to spawn the map:
Euclidean_Voronoi_diagram
Next will be the Manhattan method, it is actually easier:
Manhattan_Voronoi_Diagram
More details about how this works can be found here:
Voronoi_diagrams
Question: Are you guys actually interested if I post details like this?

cool map generation!!!

Thanks. If you place land seeds in the center and water seed in the corners of the square you get your island :wink:

ok ill try it out

What's next.

To further develop it I would appreciate some help. I might be good in tinkering those routines together, but on the other hand I still struggle with quite a few basics of Flowlab. Ask @"JR 01" how often he had to untangle my collision hit zones, LOL.

I need help with:

- Map scanning -
It is slow because of the timer in there, all thrown together in a hurry so that I could test the scanning. If I remove the timer (how dare I) Flowlab freezes …
What I need is a routine to populate the whole map with those scanner tiles as fast as possible. Since they are smaller then the 32x32 grid they have to be placed through a routine by what I am aware off? Or?

- Seed placement-
For sure the idea is to place them randomly and any amount one wants. Now … how do I keep track of them? I need their X/Y positions for the scanning. I am so used to use arrays for that, that I feel my hands are tied here *pokes @grazer *.
Has anyone a good idea how to do this?

P.S. as an alternative it might be better to just push one scanner tile over the whole map. It gets destroyed anyway.

hmmm

Minor Update

This version allows you to drag the seeds into new positions before you start a new scan. Link ->Version 0.1b

! WARNING ! No safety measures are in place. Don't drag while it scans :)

Up- Update

This version now uses the Manhattan routine, screenshot has been done with the same seed positions as the first version to show the different outcome. compare Link -> Version 0.1c

… told ya, it is easy to modify :slight_smile:

Spawn test

Related to the map generator I wanted to see how small I can make those map tiles and spawn them before I break Flowlab. 8x8 Link: Spawn test It looks like a tile size of 8x8 just works alright. I went further down to 4x4, 2x2 and even tried 1x1. At 4x4 the slow down is noticeable and my browser got stuck. At 2x2 I didn't have the patience to even wait until it fills the screen. 1x1 .. don't ask

@TinkerSmith Sounds epic. Looking forward to finished result.

Things like this you can do already:
calc

:slight_smile: 5 level height map … was too lazy to color more tiles, rofl

Applied to the map generator it looks like this:

That’s about it the speed I can achieve.
Any smaller tiles = trouble
Any bigger map = trouble
Ok, could be a bit bigger

Trying to improve the map generator and playing around with path finding I realize the thing I need most are lists (or arrays, or tables, or whatever you might want to call them).

For the ones not familiar with that term, … it is just that … a list. It allows you to save data in a more organized way for later use. Data within a list is addressed by its position within the list, mostly called the ‘index’ or pointer, or position… different terms, same thing.

This data type is not available within Flowlab by default, but it can be ‘simulated’ by creating your own bundle. I wired one up here -> List Bundle

This is just a quick mock-up, first draft, a simple ‘list’ with basic functionality.
List Block

As you can see, you address list items through their index and then you can either ‘write’ or ‘read’ to/from that position. This little list only holds 5 items, good enough for a small RPG inventory system (Health, Gold, Mana, Exp,…) or could keep the result for a dice game (Yahtzee).

The internals look like this, nothing fancy about it:

List_bundle

So … now imagine you want to create a card game :slight_smile: … 52 values to be remembered, kiss your evening good bye if you want to wire that one up :lol:
As you can see, you can speed things up by copy/pasting the highlighted block area. But I’m lazy and I am going to create a script that will do that for me.

As in: You enter a name for the list (was ‘A’ in this example) and the amount of data cells you need (please be reasonable). The generator will create the necessary code that you can copy/paste into Flowlab as you do when you copy other bundles.
It will be available online once done, probably on my Flow-Wiki site , we will see.

Now … I need some feedback before I finalize it.

  • the way I made that list bundle … is that the most straight forward, simple, safe way of doing it?
  • should I use global variables instead to make access from other areas of the game easier
  • this is the basic setup. List ‘experts’ might say, hey I need more (push, pop, init… shuffle…)
  • just list what you think it might need
  • who else here has a little bit of experience with JS/HTML to help with the web interface?

@grazer … please, please, please just one comment.
Before I go through the effort to do this, please don’t tell me … Oh, by the way, lists are part of the next update … LOL
Can I assume that functionality might still take some time to be implemented and it is worth using this work around in the meantime?

Dungeon Room Spawn Test

... closed for major renovation :)

UPDATE … working generator … sort off … :slight_smile:
Capture
Dungeon Generator v0.7

Still buggy and I need to improve the timing (too slow), but otherwise IT WORKS
In the controller block one can adjust the dungeon size, recommended to be between 3x3 and 10x10

HAVE FUN

Next steps:

  • optimizing the generator to be faster
  • adding minimap (looks over to @thebrickccentric )

Mini map added (first trial)

map_v08

Dungeon Generator v0.8

Lunch break was long enough to add a mini map, I hope it doesn’t crash. Had no time to test it through, LOL.

Work in progress … as usual

@TinkerSmith doubt youll see this tonight but when you do I have a question:how do I make it so enemies spawn only in the dungeon confinements and not on the outside?

Hmm, maths I’d say @glithctyrus .
S00807-18524381

The first room center is at X/Y 208, then the next centers are spaced out in 448pixel steps if you use it as it is.
So if you want a spawn in room 3 top row that would be for X ? ((3-1)*448)+208 and then you can add some +/- random.
Y would be straight 208 for the top row.

Initial thought out of my head, lol, better suggestions welcome :slight_smile: