My Latest Distraction

Make games! Discuss those games here.

Moderators: Bob the Hamster, marionline, SDHawk

User avatar
Pepsi Ranger
Liquid Metal Slime
Posts: 1457
Joined: Thu Nov 22, 2007 6:25 am
Location: South Florida

Post by Pepsi Ranger »

TMC wrote:You know what, rather than scripting it, I'll just finally add a new script command to do A* on a grid. Waiting for arrays or objects before adding that is just unnecessary delay. Ha! You can't get [me] out of this now!
Good, I'm glad you fell into my trap...er, I'm glad you're ready to add pathfinding to the OHR. ;)
Place Obligatory Signature Here
User avatar
Pepsi Ranger
Liquid Metal Slime
Posts: 1457
Joined: Thu Nov 22, 2007 6:25 am
Location: South Florida

Post by Pepsi Ranger »

Two months ago, I bought a game on Steam called Salt, which is basically a sandbox pirate adventure game that creates procedural generated maps according to whatever seed the player keys in at the start. In other words, calling your island chain "Margaret" would produce the same map generation every time, even though the process may appear random on the surface. Likewise, if you changed the seed name to "Annie," then you would get a different generation than if you had stuck with Margaret. The point of this is to sync up multiplayer games while still keeping things "random."

Shortly after watching the Youtube video that made me realize how seeding worked in map generation, I started thinking that I should look into doing something similar with that old park exploration game that I had put on hold while trying to figure out pathfinding and (more specifically) working on anything else. By doing so, I could hold weekly contests or challenges based on a particular map name that everyone could try, or have you guys hold challenges, or whatever.

Today, I decided to look into that more closely, and just a few minutes ago, I cracked it.

Behold, seeded procedural maps!

Park Picker
Image

Select the name of the park you want to explore here. You can call it by number or name. Or you can just explore one at random. Numbered and named parks can be found via an input code that can accept up to 16 digits or letters. Names are case sensitive.

Discovering "My Park"
Image

Each park number or name will generate a specific map depending on the size chosen. The following examples are all taken from a small map generation.

Park Size
Image

Exploring "My Park"
Image

This is the map that will always generate when "My Park" is inputted and a small map is selected from the menus.

Discovering "MyPark"
Image

Exploring "MyPark"
Image

Notice the difference in maps when "My Park" is spelled with and without a space between the two words.

Exploring "My Humps"
Image

Discovering "My Humps"
Image

A different name locates a different configuration. This map will always appear under "My Humps" at the small map generation.

Exploring "My Sherona"
Image

Discovering "My Sherona"
Image

Notice this time that the big yellow starting square is to the left of the map instead of the bottom. This is one of the rare western entrances, but "My Sherona" will always produce it.

In each of the above cases, the park was called by name. But parks can also be called by number.

Discovering Park Number "123"
Image

Exploring Park Number "123"
Image

It should be noted that sometimes the number can be the park's name. Notice how Park #123 is different than the park called "123."

Discovering "123"
Image

Exploring "123"
Image

So, as you can see, you can now discover and explore any park you want, and then compare your findings with others who wish to explore the same park. Just identify whether you'd like to search by name or number, and then select your size. The rest is simple. Just start exploring.

Alternatively, if you don't want to discover a named or numbered park, you can choose one at random, which is the original behavior. This way your park can be truly shrouded in mystery.

So, that's the latest news. I have no idea when I'll have a demo ready. I don't work on this game often enough to call it soon. But I am thinking about tabling the pathfinding feature for another time, which means I can get back to building things the next time I work on it. Even though part of my reason for tabling pathfinding comes down to handling the complex nature of the map's generation, the other reason is simply the fact that mouse support is sloooow, even in 30.3 FPS. I think I'd rather wait for mouse support in the engine to go native (which I think James and TMC have been discussing) before attempting to crack pathfinding again.
Place Obligatory Signature Here
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

I assume you implemented a hash function and feed the output to reseedrandom, but I'm curious how you hash it...

Regarding "native mouse support", that exists in nightly builds, but only works with gfx_sdl at the moment. It will definitely be fixed in gfx_directx for the Callipygous release, which is Definitely Real Soon.

Regarding pathfinding, change of plan: the new script interpreter is happening soon enough (working on making the switch sometime after Callipygous) that I assume we will add script commands for pathfinding "properly", using arrays and so on, which really means: not before then.
User avatar
Gizmog
Metal King Slime
Posts: 2622
Joined: Tue Feb 19, 2008 5:41 am

Post by Gizmog »

TMC wrote: Regarding "native mouse support", that exists in nightly builds, but only works with gfx_sdl at the moment.
Oppps!
User avatar
Pepsi Ranger
Liquid Metal Slime
Posts: 1457
Joined: Thu Nov 22, 2007 6:25 am
Location: South Florida

Post by Pepsi Ranger »

TMC wrote:I assume you implemented a hash function and feed the output to reseedrandom, but I'm curious how you hash it...
I don't know what a hash function is, but I'm gonna assume the answer is yes.

Regarding your curiosity, I'm using a basic input string command and a number from string variable in the seed random command. That's what produces the numbered parks. For the named parks, I'm using a for/do block that increments the ascii position in the string to a base number 16 times, then I'm seeding that number. Here are both scripts I'm using to do this:

Code: Select all

script,Use Number Park,begin
show text box (4)
suspend box advance
input string (1,16,false,false,160,115)
resume box advance
wait for text box
if (number from string (1)==false) then(
show text box (5)
wait for text box
Use Number Park
)
else(
seed random (number from string (1))
Choose Park Size
)
end

script,Use ASCII Park,begin
variable (f,a)
show text box (6)
suspend box advance
input string (1,16,false,false,160,125)
resume box advance
wait for text box
for (f,1,16) do(
increment (a,ascii from string (1,f))
)
seed random (a)
Choose Park Size
end
What's cool about this method is that I can now simplify reloading a map that the player saved on. Because "save map state" is temporary, I couldn't actually reload a previously generated map on a loaded game, and I didn't want to have to store values in up to 40,000 global variables or slice collections just to rebuild the last version of a map generated at random. By using the seed method, I can vastly reduce the overhead costs of saving and loading by simply recalling the base map according to the saved variable.

In cases where the player plays an unnamed map (by highlighting option #3, aka the original map generation method), I can actually hide a seed based on the numbers called during the procedural build and recall it on load. I still have to work on map reload, but that's basically how I'm gonna do it. For altered maps (where the player chops down trees or builds bridges, etc.), I'll use globals or slice collections to replace the altered tiles with the player's additions or changes. I may want to limit the resources to 10,000 instances (or some arbitrary number) to avoid the possibility that the player might alter every tile on the map somehow. This would also make it easier to save and load based on reading and writing to globals.

I hope that all makes sense.
TMC wrote:Regarding "native mouse support", that exists in nightly builds, but only works with gfx_sdl at the moment. It will definitely be fixed in gfx_directx for the Callipygous release, which is Definitely Real Soon.
I'll still want to use it for menu selection. This is gonna be a builder type game that relies on icons and windows to mouse-click.
TMC wrote:Regarding pathfinding, change of plan: the new script interpreter is happening soon enough (working on making the switch sometime after Callipygous) that I assume we will add script commands for pathfinding "properly", using arrays and so on, which really means: not before then.
I hope this is true and a plan you're committed to because that would be quite helpful.
Place Obligatory Signature Here
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

Yes, that's pretty much the simplest hash function imaginable. (A hash function is just a function which takes data as input and reduces it to a number in some way. They have many, many uses.) With the hash function you're using words which are anagrams of one another will hash to the same value, but more seriously there are only several hundred different results when given normal text, so only several different possible maps. You can use something slightly more complicated to avoid that; a common one which is very simple yet pretty decent for hashing English text is "a := a * 31 + ascii from string (1, f)".

Also, you're reading off the end of the string. I suggest not doing that, although it's not an error... yet.

Oh, so that's what you meant by mouse support. (I don't know what Giz was thinking either.) I have no idea when that's happening.

At some point it should become possible to save map states, but I wouldn't say it's very soon. Storing a random seed plus a set of edits is a fine solution.
I don't think you need to worry about limiting the number of edits the player can make. Even tens of thousands would only take a couple MB to store, and be near-instantaneous to apply.
Last edited by TMC on Wed Aug 26, 2015 11:43 am, edited 1 time in total.
User avatar
Pepsi Ranger
Liquid Metal Slime
Posts: 1457
Joined: Thu Nov 22, 2007 6:25 am
Location: South Florida

Post by Pepsi Ranger »

Yes, that's pretty much the simplest hash function imaginable. (A hash function is just a function which takes data as input and reduces it to a number in some way. They have many, many uses.) With the hash function you're using words which are anagrams of one another will hash to the same value, but more seriously there are only several hundred different results when given normal text, so only several different possible maps. You can use something slightly more complicated to avoid that; a common one which is very simple yet pretty decent for hashing English text is "a := a * 31 + ascii from string (1, f)".
Hmm, I wasn't thinking about anagrams. But you're right. "mypark" and "krampy" would produce the same map under this code. (Test Confirmed)
I'll give your method a try and see what it does differently.

Note: Okay, I changed the line, and it definitely produces a different map for each name (and I should note that "krampy" is a pretty cool park now). So, definitely thanks for the suggestion.
Also, you're reading off the end of the string. I suggest not doing that, although it's not an error... yet.
You may need to explain this one to me. Are you referring to the input string argument that defaults to "use current"? Or are you referring to the for/loop ending at 16 instead of 15? Or are you referring to something else?
Oh, so that's what you meant by mouse support. (I don't know what Giz was thinking either.) I have no idea when that's happening.


Hmm. Now you've got me wondering what you meant by mouse support.
At some point it should become possible to save map states, but I wouldn't say it's very soon. Storing a random seed plus a set of edits is a fine solution.
I don't think you need to worry about limiting the number of edits the player can make. Even tens of thousands would only take a couple MB to store, and be near-instantaneous to apply.
Well, I'm mostly concerned with how many global variables I would be tempted to use for storage. If you're saying tens of thousands is reasonable, then you're thinking of a different solution to saving changed states, and if that's the case, I'm curious to know what you're thinking because that's probably how I'd want to handle it. Ideally, I'd like the game to save any change the player makes and not limit anything.
Place Obligatory Signature Here
User avatar
Pepsi Ranger
Liquid Metal Slime
Posts: 1457
Joined: Thu Nov 22, 2007 6:25 am
Location: South Florida

Post by Pepsi Ranger »

Okay, so on that note, I just realized it's been almost a year and a half since I've first announced this game, and I never actually explained what it is. So, instead of keeping you guys in the dark any longer (because I know you've spent the last seventeen months losing sleep over the suspense), I've decided it's a good time to unveil the mystery.

Game:

Image

Most of this post will be taken from parts of the design journal I started for it on March 28, 2014:

(begin entry)

I’ve been wanting to make a “Park Tycoon” type game for a long time now, and today, as I was walking through the park, I figured out a way I can do this on the OHR. It won’t be as pretty as the game I’ve had in my head for several years—that game would be made on a 3-D engine and look as good as Roller Coaster Tycoon 3—but I think it’ll still work for the purposes I have for it.

Like Entrepreneur: The Beginning, this game will take place somewhere between L.A. and Seattle in an unexplored region near Hybrid City in that wonderful decade called the 80s.

Down on his luck, two years after Buck Star dethroned him from his Liquid Shack, Chet Armstrong finds himself wandering Hybrid Hills, trying to figure out some way of getting his luck back. His rival had already bought out every business in Hybrid City, taken over Hybrid University, and supplanted the mayor of Hybrid City from the city seat after uncovering his corruption. With nothing left in Hybrid City for him to conquer, Buck Star has left town, leaving the old sleepy town ripe for the business picking. Problem is, Chet, as ambitious as ever, has no leverage or money to get back into capitalism’s good graces.

That is, until the summer of 1987, when he stumbles onto a vast yet hidden nature preserve that is unhampered by business and in desperate need for development.

With help from Hybrid City’s master landlord, the Lease Agent, Chet Armstrong may very well have a chance at rebuilding his financial luck and business empire, as long as he doesn’t go bankrupt from transforming hidden nature into a tourist’s travel fantasy.

Today has been all about conceptualizing my ideas and thinking about what’s realistic for a game like this. Obviously, I want to change the interface style dramatically from the original game, as a game like this really wouldn’t benefit from that format. Instead of going for the “business story adventure,” I want to go more into a pure business development design, but using RPG and turn-based elements to keep my original vision of making an explorer’s game intact.

It would look like this: The player can generate one of five different sized maps (Small, Medium, Large, Micro, and Mega) and, depending on where the entrance is drawn, will appear in roughly the center edge along the south, north, east, or west boundary of the map, where he’s faced with a path, a small tree cluster, an old building that appears abandoned, and a massive shroud covering the secrets of the nature preserve ahead. Once he spawns onto the map, he can start moving around and uncovering the shroud, a la Civilization series, but each move will eat up movement points, and depending on what kind of terrain he’s traveling on, or how tired he is, or hungry, or whatever task he’s doing, each expired movement will eat up approximately one hour off the day clock.

And yes, in typical Entrepreneur fashion, there will be a record of time and days passed, though unlike Entrepreneur: The Beginning, this one, as far as I know, will not come with a deadline.

The passing of each day will have certain penalties, thanks to the Lease Agent’s iron fist, which I will determine as development continues. Also, the early part of the game will be more about exploring the park than it is about building on it; though, I do want to allow the player to set up some near-entrance attractions like picnic areas and campgrounds.

I also want a strong adventure element attached to this game. For example, when clearing out trees to make room for a new attraction, Chet might stumble upon a brood of vipers. I want the game to ask the player how Chet should handle it. Each choice would come with a pro and con. For example:

“Chet has stumbled onto a pit of vipers. He wants to clear it out. How should he handle it?”
Menu choices:
-Call an exterminator (costly, but guaranteed success)
-Call a ten-year-old boy (no cost if successful, parental lawsuit if boy goes to hospital)
-Call treasure hunter, Nebraska Smith (high cost if successful, possibly leaves behind valuable if bitten and made comatose)
-Handle it yourself (free, but may take several hours or the rest of the day to handle)
-Leave snakes alone (no change, may spawn)

Of course, no park business sim would be complete without the attractions like boat hires, ski jumps, hot dog stands, campers, and so on. Buying and placing these objects would likely use the mouse, which means I’d need to get comfortable with using slices with menus and buttons and map scrolling. This is where things could get complicated. It also means making clever use of the current tileset system. I might be limited by the current number of layers and available tiles per layer. But we’ll see.

As far as customers go, I want to make it like Entrepreneur: The Beginning’s Coffee Pavilion, where the player has the option to keep everyone out until he clicks the open sign. This will minimize bad press if there’s little to offer when the visitors begin to show.

Visitors, like Chet, will do things by turn. Real-time is always nicer, of course, but without script multitasking, handling the visitors with a sea of timers will get old quickly. Plus, with turn-based, the player can see what everyone is up to. I would probably want to give the player the option to turn off customer movements, though, or maybe highlight a few and magically transport the rest to wherever their time bars would naturally expire. I have options. Too many visitors might clutter gameplay if I track everyone. I still want to give the player the option to decide roughly how many visitors to follow.

Payments to Chet will happen by the hour. Chet’s job is to keep each visitor in the park for as long as he can. That means developing the far end of the park. That means putting in attractions that will keep each visitor’s interest for a while. Money can also be acquired through shops.

I also want to allow the player to name the park, but for this to be any kind of effective, I have to make sure the park’s name will show up in the save window.

And that’s just an overview of things I want to do with this game. I would like to have an endgame, though I don’t know exactly what yet. Like the coffee game, I think I want multiple types of endings. Maybe earning enough money to buy Hybrid City could end the game. Or earning top accolades from the Park Critic (the former Coffee Critic). Or maybe a competitor kidnaps him. I don’t know. I’ve got to think about that one.

(end journal excerpt)

The rest of the journal entry covers the parts that I've done in that first day, but this will give you guys an idea what I plan to do as development unfolds. As I said, I'm focused on other things right now, so I'm still just picking at development, but I do hope to speed things up once I get to that place where it's practical. As always, I'll keep you guys informed when something interesting happens with this.
Place Obligatory Signature Here
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

I still think it a bit odd for the protagonist of this game to be the antagonist of the previous one. So spend all that time hating an imaginary character and suddenly your moral basis for making all that money (to one-up Chet) is reversed.

It's not just anagrams, trillions of different phrases would hash to the same value when using the old addition method. E.g. HAL9000 and IBM6000.

I meant that you should write "for (f,1,string length(1)) do(...)" to correctly iterate over the string. And if you store map edits in slices then there's no limit.

The mouse support I was talking about is simply the ability to use the normal mouse cursor for the operating system. That way it doesn't matter what the framerate of the game is, and you don't need to draw it yourself either. unhide mouse cursor
User avatar
Pepsi Ranger
Liquid Metal Slime
Posts: 1457
Joined: Thu Nov 22, 2007 6:25 am
Location: South Florida

Post by Pepsi Ranger »

Hmm, it's been two years since I've posted in this thread. In that time, Photobucket had severed the links to all of my promo pictures...jerks...but James has managed to make one of my gameplay goals much, much easier to handle, and yesterday I finally got to put that gameplay goal to the test.

And I made a video of it!

This is the first video I've made for this game, so now you can see what some of the hype is about, especially now that all of the photos are temporarily grayed out, which I hope to fix in the near future, whenever I can find the time to move all of my photos to a new host.

As you can see, there still isn't an actual game in place, and I definitely need to refine some things. But this is the template I'll be working with as I move closer to actual development. Now that mouse-movement and pathfinding are better supported, I can begin to see my vision come together sooner and faster. Hopefully it will also shed some light on my plans for the game.

Enjoy the preview.
Place Obligatory Signature Here
User avatar
kylekrack
Liquid Metal Slime
Posts: 1240
Joined: Mon Jun 16, 2014 8:58 am
Location: USA
Contact:

Post by kylekrack »

Awesome! I remember finding this and thinking how cool it looked. I'm hyped that a big mechanical roadblock is taken care of now. Hopefully we'll get to see some gameplay pretty soon.
My pronouns are they/them
Ps. I love my wife
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

My audio isn't working, but I watched part of the video. I noticed that at the 5 min mark you clicked to move somewhere but the hero only walked halfway. Is that the remains of your previous "landmarks" pathfinding system?
User avatar
Pepsi Ranger
Liquid Metal Slime
Posts: 1457
Joined: Thu Nov 22, 2007 6:25 am
Location: South Florida

Post by Pepsi Ranger »

That's actually part of my new safeguard to prevent locking in the event the pathfinding destination is difficult or impossible to reach. I have to use a wait in that script in order for the shroud to work (I think--it's been a while since I really examined the pieces of this plotscript), and a failure to find a path would mean the script locking up for about 1000 ticks. That pause in the middle is also the reason why I requested a "repeat last mouse click" command, though a "pathfind hero to (who,x,y,stuck ticks)" would work just as effectively for this cause, if not require a couple additional steps to essentially work the same way. I'd be happy with the latter function. It would also make my scripting in Powerstick Man XE so much easier, faster, and more thorough, so I'd like to see it anyway.
Place Obligatory Signature Here
Post Reply