Procedural JRPG - preAlpha 2

Show off your games, demos and other (playable) creations.
Post Reply
milon
Prole
Posts: 25
Joined: Thu Jan 18, 2018 9:14 pm

Procedural JRPG - preAlpha 2

Post by milon » Thu Mar 08, 2018 3:35 pm

Updated! Scroll down for the latest release.

=========================

Here's a thing I've been working on!

Image

The long-term goal of this project is a procedural (J)RPG heavily inspired by Castle of the Winds. The aim is to be light-weight, intuitive, and highly replayable. And hopefully, fun!

Image

Currently, it generates a random world map, draws a minimap, and lays down some locations & roads. That's it. I have very little free time for coding, and I'm an amateur to boot. No towns or dungeons are being generated yet, but I want to see if there's any interest from you all - there don't seem to be many RPG's kicking around here. Pretty much everything is in rough shape (being pre-alpha and all), but hopefully it's interesting enough to earn some downloads.

Image

Let me know what you think! I'm open to comments, suggestions, improvements, laughter, mocking, whatever. I'm doing this for my own enjoyment, but if others like it too that's even better!
Attachments
CotW.love
Includes 100% pre-alpha shoddiness!
(78.56 KiB) Downloaded 63 times
Last edited by milon on Tue Mar 20, 2018 4:53 pm, edited 1 time in total.

milon
Prole
Posts: 25
Joined: Thu Jan 18, 2018 9:14 pm

Re: Procedural JRPG - preAlpha 1

Post by milon » Mon Mar 19, 2018 11:02 pm

Here's preAlpha 2! Pathfinding is much faster and not insane (mostly). The world border isn't messed up anymore. And it even ensures that all towns (the signpost placeholder graphics) are all accessible! If it's surrounded by water, it'll add boats. If it's surrounded by mountains, it'll carve a tunnel. It's still only the world map (my free time is quite limited), but I'm really pleased with how it's coming along. :)
Attachments
CotW.love
In case you were wondering, CotW is the working title (LOL)
(33.94 KiB) Downloaded 28 times

NotARaptor
Prole
Posts: 34
Joined: Thu Feb 22, 2018 3:15 pm

Re: Procedural JRPG - preAlpha 1

Post by NotARaptor » Tue Mar 20, 2018 12:10 pm

I like it! Nice detail on the world generation - I love stuff like this. Have you read the red blob games article? Seeing your comment "Use more kinds of trees ??" made me think of that one.

A couple of observations! (of course)

- Split up the M.createNewWorld function into smaller functions - the flow is difficult to visualise, even though it's linear. For example it took me a bit of time to figure out what the terrainVal table was for, as it's referenced quite a bit further down.

- Make the terrain costs a variable table that is passed to the M.pathfind function. The values you've defined there are for ease of road generation, but once you've got NPCs who want to go places, they'll be using pathfinding and will (may?) have different values. Not sure exactly what kind of entities you're planning, but to be very stereotypical you might have elves that prefer to walk in woods, dwarfs who travel in mountains, swamp trolls that don't venture far from the swamp, etc.

- It's spelled "Voronoi" :) If you're interested in algorithms, there are some really cool ones for computing Voronoi diagrams and their duals (Delaunay triangulations) efficiently, although it's probably overkill for small maps like you have here - good fun if you're into it though!

This might sound a bit odd for a personal project, but I'd highly recommend using some kind of task management tool (e.g. JIRA) and (if you're not already) source code control (git). Especially if you don't have a lot of time to work on the project, having all your tasks listed makes it easier to remember "what I was doing" and decide "what to do now", and also seeing the completed tasks gives you a sense of satisfaction. Using SCC allows you to easily branch the code off to explore a different feature without fear of it breaking the existing code, without having "backup1", "backup2", "test1", "final", "final2", "finalREAL" copies of the project :)

But yeah, I like it!

Sidenote : I used {b} bbcode tags for function/variable names - there doesn't seem to be a way to use inline code rather than code blocks?

milon
Prole
Posts: 25
Joined: Thu Jan 18, 2018 9:14 pm

Re: Procedural JRPG - preAlpha 1

Post by milon » Tue Mar 20, 2018 1:26 pm

Thanks for the response! I have *very* little formal training, so input is always helpful. :)

Yeah, I've read a bunch of stuff from red blob, and other places too. The graphics are mostly placeholders, so that's a detail for me to consider later. I've even thought about hot/cold biome graphics, but the essence of this game is "lite procedural JRPG", so we'll see.

I agree that the M.createNewWorld function needs help. I also don't like how long it is, but wasn't certain the best way to deal with that. I'll think about splitting it up a bit. I put my constants near the top to make tweaking easier, but it would be much simpler if it was in a small(er) function rather than at the other end of a really long block.

Good call about the terrain costs getting passed to the pathfinding function. I do want to keep it lite, so most NPC's will wander around randomly or even just sit stationary, but I'm sure I'll want some entity pathfinding.

Hehe, oops! Thanks for catching my typo. :crazy:

Hmm, I've never considered using SCC for a one-man project. I'll think about it. I've been fine so far just keeping a to-do list at the top of the main file - and dropping in a 'testing' folder with its own main.lua to try new ideas before throwing them in the mix. But I can see where some kind of version control setup might be useful.

An no, there's no way (that I know of) to display code in-line in the forum. *shrug*

NotARaptor
Prole
Posts: 34
Joined: Thu Feb 22, 2018 3:15 pm

Re: Procedural JRPG - preAlpha 1

Post by NotARaptor » Tue Mar 20, 2018 4:30 pm

No need to worry about the graphics! Everyone uses placeholders to start - most of my concepts are just rectangles and circles.

One suggestion I have is during your road building part, if you're crossing water you use boats - nice little concept :) I would also suggest bridges as a concept for crossing rivers, as a feature. Not just for cosmetics, but because blocking bridges is always a fun tactic - the pas d'armes would be great for simple NPCs. And the stereotypical troll, of course! Also bridges can be destroyed and rebuilt - so many fun mechanics to be had.

Am I correct in thinking that your "features" (cities, ruins etc) will be a single square on the overhead map, but when you enter them they act as a door mechanic to another map (inside the city)? I love this - makes it very simple to build up worlds. On a multi-level tier, you could have overworld feature which links to town map, then each building having a door linking to the "inside building" map - and they could all be procedurally generated! Storing a certain attribute at each feature level to generate the random seed.

How are you planning to handle combat? Roguelike-style? Or fighting goes into a different map/view to resolve the combat?

Probably not at all what you're planning, but something I might do myself (I love tinkering with ideas - and this RPG concept has inspired me) would be to not go full roguelike (continuous) movement, but to restrict the movement into "turns" where you have movement/action points, and you end your turn when you're done. You could hide, wait in ambush, engage in combat, search... several actions depending on the context, and of course so could the NPCs.

If you don't mind, I might borrow some of your map generation code :) I did write something similar years ago - ironically I think I had issues with the road building - but that was in FlashPunk, and I doubt I still have the code around anywhere.

milon
Prole
Posts: 25
Joined: Thu Jan 18, 2018 9:14 pm

Re: Procedural JRPG - preAlpha 2

Post by milon » Tue Mar 20, 2018 5:38 pm

About bridges - if they're only 1 or 2 tiles long, it'll just draw the road overtop rather than placing boats. (Same goes for mountains, btw.) I thought about using bridge graphics, but it's entirely possible that the road building will create a 3- or 4-way intersection over water, and I'd like to avoid needing another entire set of images just for that corner case. But whether it's a boat or a road that paths over water, it can still be blocked by evil/mischievous creatures, political events, etc. :)

The map "Features" (friendly towns, hostile dungeons, and even tunnels) will all be separate maps that you can travel through. The boats might become separate maps, but either way I'm picturing a dialog box offering to transport you for a certain price. Events can be added to that too - getting kidnapped by pirates or overhearing something important, etc.

Combat will, at least initially, be roguelike-style (think Castle of the Winds). I have a lot of ideas, and I'm still deciding if I'm making one game or two, lol. :) But I hadn't thought of using just assigning everyone a certain amount of Action Points and then iterating through each entity. I'll think about it - it's worked well for the Exile/Avernum games made by Spiderweb Software (another source of inspiration for me).

And definitely - borrow any code you want to! That's one of my reasons for putting the code online. :D
My current road-building implementation is as follows:
1. Calculate the Manhattan distance between all nodes
2. Sort by distance, shortest first
3. Add the shortest route to the to-build list
4. Work through the rest of the list, adding to the to-build list any route that connects an already-connected with an unconnected node, until nothing new gets added
5. Pathfind the route (A*) for each of the to-build routes, applying special rules for pathing over mountains (create a tunnel) and over water (bridge/boat), then laying down actual roads where appropriate (don't pathfind to a dungeon from a city)

I think this guarantees that all nodes are connected, and therefore all nodes are accessible regardless of terrain. :)

Post Reply

Who is online

Users browsing this forum: MissDanish and 5 guests