Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411511 Posts in 69375 Topics- by 58430 Members - Latest Member: Jesse Webb

April 26, 2024, 12:59:47 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityDevLogsDream Harbor - Replay 3 Days of Time (Action RPG)
Pages: [1]
Print
Author Topic: Dream Harbor - Replay 3 Days of Time (Action RPG)  (Read 2596 times)
johnfn
Level 0
**



View Profile
« on: January 28, 2018, 11:11:38 AM »

Hey guys,

I'm working on an RPG called Dream Harbor.

The big idea of Dream Harbor is that a darkness called Blight* is spreading, and in 3 days it will take over the world. Fortunately, you can repeatedly play out the same 3-day sequence, carrying items and experience with you between each sequence, to eventually defeat the Blight. You'll be able to back in time and try doing things differently in order to see how your changes play out over the 3 days. A large part of Dream Harbor will be seeing the effects of the small changes you make.

If you've played Majora's Mask, that's definitely a big inspiration of mine! Smiley

Stuff I like

- Environmental puzzles that are integrated with the real world. I dislike abstract puzzles that have nothing to do with the surroundings. Conversely, I love puzzles that feel integrated with the game world somehow.

- Really imaginative fantasy worlds and settings. In the world of Dream Harbor, all life exists in a group of hundreds of small worlds interconnected with bridges that span space. You find yourself on Dream Harbor, a world where there is no physical bound between reality and memory, which is being torn apart by a mysterious dark force**.

All of the above is pending at this point! I've only started working on the game recently, so a lot of the details are up in the air. (Though the story and setting have been bobbing around in my mind for a good year at this point!)

* Good name pending
** Good description pending
« Last Edit: February 02, 2018, 09:29:12 AM by johnfn » Logged

I'm working on Dream Harbor, a time-rewriting action-RPG, I run a music competition website, and I do other stuff too sometimes.
johnfn
Level 0
**



View Profile
« Reply #1 on: January 28, 2018, 11:15:29 AM »

Index

Jan 28 - [Voxel Editor] - Starting in-game voxel map editor
Jan 29 - [Voxel Editor] - Painting individual tiles in voxel map editor
Feb 1 - [Voxel Editor] - Editing separate map chunks
Feb 5 - [Voxel Editor] - Serializing data for Unity
« Last Edit: February 05, 2018, 10:53:18 PM by johnfn » Logged

I'm working on Dream Harbor, a time-rewriting action-RPG, I run a music competition website, and I do other stuff too sometimes.
johnfn
Level 0
**



View Profile
« Reply #2 on: January 28, 2018, 11:39:06 AM »

Here's what the game looks on the FIRST DAY I've decided to post it up here, or about a week of work total (E.G. SUPER JANKY LOTS OF WORK TO DO!!!). I'm going for a cute 3D voxely style that hopefully isn't too demanding on my limited artistic prowess.

The tall shutter-looking thing is actually supposed to be a waterfall but we have a bit of a graphical glitch currently... Tongue

I might end up finding an artist anyways if this becomes a more serious project.

Logged

I'm working on Dream Harbor, a time-rewriting action-RPG, I run a music competition website, and I do other stuff too sometimes.
johnfn
Level 0
**



View Profile
« Reply #3 on: January 29, 2018, 12:52:15 AM »

Jan 28

Over the last few days I've been experimenting with different possibilities for voxel-based map editing. At first my idea was to use MagicaVoxel as a map editor in addition to a voxel editor, since it's quite versatile and the dev recently added a really neat 'world editing' mode. Problem is, I would like my world to be tiled like 2D games are tiled to a degree (the prospect of hand-voxelling an entire 3d game world is ... intimidating, to say the least!). And MagicaVoxel has no concept of tiling. So for a while I was experimenting with using colors in MagicaVoxel to map to tiles, and I had hand-written a C# script to read a colored MagicaVoxel model and turn that into the map. However I quickly found this to be totally unmanageable.

I was a bit puzzled by how I was going to design my world if I couldn't use MagicaVoxel. I played with the idea of building an entire world-editor for at least an hour or so before realizing it was pretty dumb. Instead, the solution I came upon was to build a world-editor within Unity, using Unity's editor scripts which should ideally save me a lot of time over hand-rolling, since Unity takes care of a lot of the stuff I'd have to hand-implement (like a decent camera system and translating through the 3d world etc).

It turns out I was right about the potential time saving. I have now built a small world-voxel-editor inside Unity! Yep, I completely recreated MagicaVoxel... made about two thirds of MagicaVoxel ... made some amount of MagicaVoxel... I did something. It lets you add voxels directly inside Unity!



Sadly, I spent most of the day spending a bunch of time optimizing the dumb thing. Initially I was creating a new Unity GameObject per voxel, but 20x20x20 = 8000 game objects = you just crashed Unity. So I converted it into a mesh and then did some rough optimizations. This worked alright, but then I had a pile-up of bugs where raycasts into the mesh weren't calculating correctly because it turned out that I needed to update the MeshCollider to have the reference to the newly created Mesh rather than the old one. Why doesn't it just figure out that you updated it? Urgh. And it was spamming like 5000 errors to the console, which caused me to miss the fact that I had a compilation error, causing me to change my code for 30 minutes without any effect. Derp.

This whole project is my first exercise in 3D coding, which is making me feel like a noob all over again. It's actually pretty fun to have so much unexplored territory, though!

Anyway, I finally got it working, so that's nice! I pushed through because I felt like it would be stupid to not even make progress on my first day of devlog. ;-)

Tomorrow I hope to add a voxel remover function (sadly, I had this before I started doing the optimizations, so it should be "easy"). I would also like to add painting, so I can start choosing which tile I want to add to the map rather than adding a cube every time. I mean, a perfect cube world does have some appeal to me, but uh, variety is the spice of life. Or something. All this is in service of eventually creating the first section of the game, which will be the cave right at the beginning of the game. Unfortunately I won't be able to get cracking on that for at least another day or two.
Logged

I'm working on Dream Harbor, a time-rewriting action-RPG, I run a music competition website, and I do other stuff too sometimes.
johnfn
Level 0
**



View Profile
« Reply #4 on: January 29, 2018, 11:34:03 PM »

Jan 29



Hey, you can paint tiles now!

Today, like I was hoping yesterday, I got around to tile selection for my in-Unity map voxel editor for the game. According to git, I've only been working on this project for 9 days, so we're still in the VERY VERY preliminary states, which is why I am doing such boring GROUND LAYING work. (Literally! Get it? It's a pun? Ok, I'm pretty sure you get it now. Wait, don't leave...) A lot of it has been just struggling with wrapping my head around all these new 3D concepts. (I've done game dev before, but I've almost always been strictly 2D.) It feels pretty reasonable to start with working on the map editor, since that won't really have to be production-grade code, so I can afford to screw it up a little bit. :-)

Sadly today probably the bug that took me the most time was simply getting the stupid tile selection for the tilemap to stay at a consistent place in the camera so you can always select as you zoom and pan around the scene. This is because at the time I didn't really understand the different coordinate systems - screen space, world space, local space, the terminology is a little overwhelming until you understand what it all means! And sadly it turns out guessing until it works is not a very efficient strategy. ;-)

After getting that to work, I worked on the code to display all the tile models without exceeding Unity's 65k vertex limit on models. Someone on the Unity discord suggested using submeshes, which turned out to totally change my life. I had previously written a manual vertex batcher and mesh maker, which turned out to be the dumbest thing ever and a gigantic reinvention of the wheel since with submeshes Unity will do all the batching for you!

Of course, it'd be pretty nice not to have hundreds of thousands of meshes in my tiny level geometry in the first place. I wrote a simple greedy mesher a few days ago, but it turned out to be too slow to do in real time (I would be meshing something like 20x20x20x6x4=200,000 vertices per map chunk in the very smallest case!!), but now that I have everything integrated into the editor, my friend suggested I have a button that creates an optimized .obj while I go get coffee or something.

This 3D stuff is pretty tricky! I admit to being a little jealous when browsing through other devlogs and seeing the devs just breezing through iterations and experiments. I'm sure I'll get there once I wrap my head around all the typical error cases and stuff.

Tomorrow looks like it's going to be polishing up the map editor + using those maps in game. That second part could be a little tricky. I will also need to figure out how to do collision at some point. I currently have a JSON file of tile properties - not sure if that's really optimal...
Logged

I'm working on Dream Harbor, a time-rewriting action-RPG, I run a music competition website, and I do other stuff too sometimes.
Penguinoccio
Level 0
**



View Profile
« Reply #5 on: January 30, 2018, 10:55:23 AM »

I never got into Majora's Mask, but I really like time loops.

Wish you well!
Logged
johnfn
Level 0
**



View Profile
« Reply #6 on: February 01, 2018, 11:03:24 PM »

I never got into Majora's Mask, but I really like time loops.

Wish you well!

Thanks! Smiley

Feb. 1

Over the last few days I've continued working on the map editor, and I think it's pretty much to the point where I can start using it now.

Fun story. Today I was idly browsing the Internet, and I found Unity had a list of completed features. Not really expecting to find anything of use, I started browsing, and LITERALLY THE FIRST ITEM was something that I would have killed to have known a week ago. Turns out that the 65k vertex limit that I've been griping about isn't actually a limit at all - it's a flag that you can switch on or off! And if you switch it off, it goes up from 65k to something in the billions - something I'll never exceed, anyways. So yeah, after spending hours on random batching approaches, it turns out that 100% of that was completely unnecessary and could all be replaced with a single line of code. Bleh.

Other than that, I've finally got map editing actually able to create meshes and game objects! I mean, the meshes are super unoptimized and unculled and etc, but hey, they exist, so that's a cool thing. Today, one of the challenges I was facing was how to serialize additional collision information along with the model. I store collision as a Dictionary of Vector3Ints to booleans currently, and Unity refuses to serialize Dictionaries for whatever reason. I went down a long rabbit-hole of manual serialization before eventually just rewriting the Dictionary into two parallel List<>s and serializing those. Seriously, why can't Unity do that for me??

Aside from that though, I'm pretty pleased with what I have! Looks like tomorrow I'll start integrating the maps I've made with the player to let him walk around them. Woo

Logged

I'm working on Dream Harbor, a time-rewriting action-RPG, I run a music competition website, and I do other stuff too sometimes.
Penguinoccio
Level 0
**



View Profile
« Reply #7 on: February 02, 2018, 01:26:55 PM »

I'm working on the data side of an MMO and the amount of time and effort spent on serialization alone is astounding. You'd think something like this would have a clear, mature solution.
Logged
johnfn
Level 0
**



View Profile
« Reply #8 on: February 05, 2018, 10:51:13 PM »

I'm working on the data side of an MMO and the amount of time and effort spent on serialization alone is astounding. You'd think something like this would have a clear, mature solution.

I kind of feel that way about a lot of Unity ;-)



Player interaction with maps! Editing live in edit mode!

Feb 5 - Properly serializing map data for Unity

Huh, I missed a few days there. Not that I haven't been working, but I just ran out of time at the end of the day to write up my progress here, for one reason or another...

On Saturday and Sunday I was procrastinating working on the game, so I worked on some music for the game instead, which is coming along nicely! I'm not exactly sure where I'm going to use it though. My approach to music is always to let the song do what it wants rather than to guide it, and the song is coming out far too happily for such a moody game. :-) Maybe I'll have to switch up the mood of the game a little. As much as I've been drawn to dark moody stuff, my strengths have always lied in the more up-beat and humorous stuff. Then again, I just watched Three Billboards Outside of Ebbing, Missouri and it combined moody with humor really well. Maybe I could use that sort of approach. Harum. Anyways, I'm getting off topic!

Today the majority of my time was spent learning how to correctly serialize data for Unity. This meant learning all of Unity's idiosyncratic serialization rules, like adding [Serializeable] everywhere and then writing my own custom Dictionary wrapper class that wasn't generic so that I could use that everywhere instead of C#'s native Dictionary (since Unity can't serialize generics, except it can serialize List<T> for some reason. Don't question it.). This feels pretty insane to me, and it's not even the most insane thing I encountered today. I ran into an extra nasty bug where Unity was deserializing the same object three times when I only expected it to do it once. It was the first time in a long time where I've just been utterly baffled by a bug. I stared at the computer for like 10 minutes, gave up, came back, stared for 10 minutes, gave up again, and repeated that process like 5 times before eventually logging every single function call so I could see exactly what was going on. That proved to be the winning approach to understanding the bug, so maybe I should remember that for future tricky problems. Smiley

Anyways, once I got serialization working, that meant that I play the game and Unity would properly serialize all my maps and my character could interact with them, which was neat! However I was immediately stymied by another problem, which was that if I made edits to the map in Play mode, then when I finished playing, all my edits would be reverted.

So I casually searched for how to carry over edit mode changes into google...

...and then I clicked through a few results...

...and then 30 minutes passed...

...and then I started begging people on Discord for some way to do it because I was sure I was missing something obvious...

Nope, turns out I wasn't missing anything obvious. Unity has not implemented this INCREDIBLY TRIVIAL AND HUGELY IMPORTANT FEATURE. When I said "not the most insane thing I encountered," THIS was the most insane thing I encountered today. HOW IN GODS GREEN EARTH IS THIS POSSIBLE. Someone on Discord helpfully suggested ScriptableObject though, and that was really useful, especially because I watched this Youtube video the other day about how you should use ScriptableObject for everything. So I hooked up ScriptableObject for my map serialization data and BOOM, now I can edit maps in Play mode and the edits will persist even after the game is over! How awesome is that?

Anyway, I am feeling quite pleased with this Voxel World Editor that I've whipped up over the last week, and I think it's time to move on to something else, finally! I know I keep saying that, but this time for real.
Logged

I'm working on Dream Harbor, a time-rewriting action-RPG, I run a music competition website, and I do other stuff too sometimes.
johnfn
Level 0
**



View Profile
« Reply #9 on: February 06, 2018, 11:59:15 PM »



Yay, the first "level," ever! Also, water that has no culling whatsoever...

Feb 6 - Tileset properties, first level

So today as promised I finally wrapped up work on the world voxel editor and started working on the world map instead. The first step here was creating data indicating whether tiles in my different tilesets were walkable or deadly or climbable or whatever else. A week or so I had come up with this way to do this via JSON files, but a week ago I was blind to the ways of ScriptableObject!!! I deleted all that old code and replaced it with new code using ScriptableObject and that made the entire thing snap together much nicer. It also plays nicer with Unity in general, which is awesome. I'm slowly starting to feel like I understand the "Unity way" of doing stuff, which feels great!

Which means working on the very first screen you will ever see! You start in a cave, for reasons. (I actually do have storywise reasons why this happens, but I don't want to ruin the story before the game even exists :-)) After I edited the screen in my shiny new voxel world editor, I instantly wanted to make the water transparent. Which turns out to be a huge pain because it's currently part of an enormous mesh which is not transparent, and in fact has a custom material for rendering it which is probably pretty tricky to make transparent... OR IS IT? Now I'm having doubts, argh. Well, whatever. For now I just separated it into two meshes and I made the water mesh transparent, but I should really look into that more.
« Last Edit: February 07, 2018, 12:31:55 AM by johnfn » Logged

I'm working on Dream Harbor, a time-rewriting action-RPG, I run a music competition website, and I do other stuff too sometimes.
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic