More editor progress

World Editor

Last night I finished almost all of the items on my to-do list for another world editor update.  Specifically, I can now:

  • Zoom the camera in and out so that seeing and moving around a large map is much easier.
  • Change the size and strength of the selection sphere.  Changing the size is pretty self-explanatory, but changing strength means that vertices move up and down faster or slower (depending on the strength of the tool) when raising/lowering the terrain.  This is handy for making big changes, then coming back to fine tune things.
  • Smooth terrains.  I don’t really like the smoothing functionality right now, but it does work.  The problem with it is that all the vertices within the selection sphere move toward the average height of all the selected vertices at the same rate.  So vertices right out at the edge of the sphere move up and down by the same amount as those near the center of the selection sphere.  Ideally I would be able to choose this behavior, or have the default that smoothing has more effect on vertices near the middle and less effect on those near the edge.  I tried doing it this way but ran into some issues with the lerp function in THREE.js.  In any case, it works okay for now and I can improve this later.
  • Flatten terrains.  This tool is super basic at the moment since all it does is set the y value of any vertices inside the selection sphere to 0.  Eventually it would be nice to have the option to set the desired flattening height, but that’s definitely a job for another day.

I did NOT make any improvements to the selection tool within the world editor.  I looked at DecalGeometry but didn’t really like it.  I did some research on shaders but quickly realized I don’t even know the basics of shaders.  This doesn’t seem like a feature that should hold up progress so I’m going to leave it for now, but this is something I want to improve eventually and I think learning more about GLSL would be time well spent.

These are some nice improvements but I still have miles and miles to go.  I think the next feature to add is the ability to place assets into a scene and save out a map file.  I’m not going to worry about rotation or scale right now, just getting some stuff into the world then saving out a map file that can be loaded by the engine.  Hopefully this will only take a few days, and I’ll post again when it’s done.

Editor progress update

World Editor

After much wailing and gnashing of teeth I seem to have heightmap saving and loading working properly.  Now you can load up a scene, make changes to the terrain height, save the scene, refresh the page, load the scene you just saved, and the terrain changes you made earlier are persistent.  The heightmap data is stored in a PNG image that gets stored on the server whenever you save the scene.  This has been relatively complicated to get going because THREE.js dropped all non-buffer based geometry.  This is, apparently, a much more efficient way to send data to the GPU but it means you can’t just loop through a geometry object’s vertices.  Instead you must access the geometry’s ‘position’ attribute array, and make changes there.  It’s actually not that much different it just throws my head for a loop because geometries have position attributes as well as indices that define individual faces.  I may be overthinking the relationship between the indices array and the vertices array, but in any case it gives me trouble occasionally.  But, for now, scene saving is working again.

My next step is to implement camera zooming.  It’s really tough to edit terrains efficiently when you can only see the terrain from a fixed distance.  I then need to create different terrain editing tools that are adjustable.  Right now all you can do is raise or lower the terrain vertices within a statically sized selection sphere.  I need to be able to perform other functions like smoothing and flattening as well as change the size and strength of the selection sphere.  I also don’t like the idea of displaying the selection tool as a sphere.  Hopefully I can figure out how to make it a decal instead that changes appearance based on the size and strength adjustments made by the user.

I’ll be working on these features for the next few days and will post again when they are done.  Oh, and happy Valentine’s Day everyone.

A Bridge!

Asset Spotlight, Planning and Development

I missed my self-set deadline of last night by just a smidge, but here’s this week’s asset spotlight: a stone bridge!

This bridge would fit in a medium-ish sized town because it’s pretty big and would clearly take quite a bit of material to make.  Can I level with you guys here?  This particular asset may not be completely finished.  You might have surmised this by the terrible wood texture and the absolutely horrible, incomplete stone texture.  I’m only showing you this view because the other side of the bridge is just flat gray.  Anyway, there’s still some work to do but I wanted to get something posted regardless.  Who knows, maybe one day there will be an actual game to play along with a community of actual players, and maybe I’ll ask some of those nice people to help me with the art in exchange for credits or recognition in the game?  Make it kind of collaborative?  I don’t know.  There has to be an actual game first.

Anyway, I kind of rushed this out because I’ve been spending what little mental capacity I have on improving the world editor.  You can now open a new scene, use an interactive brush to raise and lower the terrain, then save the changes out to a heightmap file.  Of course, the heightmap is being written wrong right now so when you reload the scene using that file it puts all your changes in the wrong places, but I’m making progress nonetheless.

I’ll try a slightly less ambitious asset spotlight for next Friday, and hopefully post about world editor improvements before then.  Stay tuned.

Editor Progress

Planning and Development, World Editor

I’m making decent progress on the world editor rewrite.  I’m miles ahead of where I would be if I had started over from scratch, but it’s still fairly slow going.  Every time I start over on this project that I’ve been dreaming of finishing for the last roughly 15 years it gets a little better.  I don’t think I’m necessarily a better programmer now than I was 10 years or 5 years ago, maybe I just have better resources at my disposal (I’m looking at you, stackoverflow).  In any case, the world editor now loads a flat terrain with a grass texture on it by default.  You can open a single (for now) map that only contains a heightmap for the terrain and nothing else.  You can then pan and orbit the camera around to look at the bumpy monstrosity of a terrain, and even save it to a heightmap file.  Of course, you can’t actually edit the terrain  yet so you’re just saving the file back over the one already on the server, but you can do it.  Here’s what it looks like right now:

Pretty impressive, huh?  Ok, I know it’s not, but it’s a good start.

Speaking of heightmaps, the heightmaps I’m using allow an absolutely huge range of heights but with incredibly fine details.  The lowest possible height is -32,768 meters and the maximum height is 32,768 meters, but the height of each individual vertex can vary by as little as 4 millimeters.  I will never really need the extreme detail or extreme range possible with the heightmap system I created, but it’s nice to have and doesn’t really cost anything extra in terms of storage or computation over a standard grayscale heightmap.  I’ll have to do an entire post on how my system works one day.  I’m sure I’m not the first to do heightmaps this way, but I’ve never found any resources describing my system so it might make a good read for someone.

I’ll keep at it with the world editor and make a concerted effort to get a second asset spotlight posted this Friday.  Until then.

A Crate!

Asset Spotlight, Planning and Development

This is the first asset spotlight for the new project so I decided to go with something as simple and cliché as possible.  So I made a crate.

This is a rendered image out of Blender, so it isn’t necessarily exactly how it will look in the game world, but it should be pretty close.  I’m trying to keep everything as resource-light as I possibly can, so this crate has 240 triangles and a single diffuse texture that is 256×256.  The triangle count is actually a little higher than I expected but I wanted some minor wobbles in the actual geometry to try and make it look a little more interesting, and unfortunately that requires triangles.  Still, 240 is pretty low for a game asset of any size at all.

I’m okay with the look of the crate overall but the wood texture needs some work.  I don’t even have a drawing tablet right now so with my limited art skills and dragging around a clunky mouse this was the best I could do.  I will eventually redraw that.  The metal isn’t exactly professional quality, but I’m still fairly happy with it for the time being.

Once the game is a little farther along I will do asset spotlights using renders from the actual game, but for now you can at least see where I’m trying to go with this.

Speaking of the game world, I found the code for the world editor I had previously written so I am in the process of tweaking that to work for the new environment of this iteration of the game.  That should save me a ton of time because the editor is already around 1800 lines of code, and tweaking that much code base rather that rewriting from scratch will be a big help.

I’m going to try really hard to post to the blog every Friday this month and so far I’m off to a good start, so fingers crossed I’ll see you in a week with another update.

Development plan – 2022.01.31

Planning and Development

I have implemented the most very basic features of a game.  Namely, you can walk around a flat map with a camera that follows the camera and which you can clumsily control.  I think the next best thing to begin working on is the terrain.  The problem with this is that it opens a huge can of worms.  Said can is opened due to the fact that I am not using a game engine to develop this, only THREE.js, and so I need a tool to create a terrain.  I could always just use an image editor to create a monochrome heightmap then alter the base plane to fit that heightmap but that’s not really a full solution.  Well, I guess I mean it’s just very difficult to maintain.  I would have to guess about the y-location of every asset I ever added to a scene because it would be nearly impossible to tell the height of the terrain at any given point in the world.

So what does this all mean?  It means I need a world editor.  I need a tool where I can create, load, and save chunks of the game world.  I’ve actually done a good bit of this work on previous incomplete projects so it’s not a completely overwhelming thought.  That being said, if I’m working on a world editor then I’m obviously not working on visible features in the game.  Still, it’s a necessary tool that I absolutely won’t be able to move forward without.  I will probably spend the month of February working on the world editor and hopefully I will have a mostly-functional tool by March 1.  In between coding I will be working on story lines, lore, and creating some proof-of-concept art assets to use once the editor is available.

So, the schedule for the month of February is as follows:

  • Blog some kind of art asset February 5th, 12th, 19th, and 26th.
  • Work on the world editor and get a usable scene in place for a new release on March 1st.

I think that’s a reasonable schedule and I’m going to try very hard to stick with it.

v0.00.002 Release

Release Announcement

Today I finished most of the features I said would be in v0.00.002 so I went ahead and released it.  I found a slightly better process to obfuscate all the code and pack it into a release, so hopefully that will make future releases a little easier.  Check out the game page to see the newest release and the notes.  I’m going to spend a day or so thinking about what I want to put into the next release then I’ll post about it.  And then I guess I’ll start actually working on it.

Camera Controls

Planning and Development

Tonight I implemented some glitchy but improved camera controls.  You can now spin the camera around the player and move the pitch of the camera up and down, as well as zoom in and out.  Right now there are no limits on any of these controls so you can spin around like crazy, move the camera past vertical up and down, zoom in past the character model or out infinitely, etc.  But those limits can be put in place pretty easily.

I’ve implemented these same controls numerous times in other projects and every time I go back to a YouTube channel called ThinMatrix for reference.  He has lots of nice tutorials on game development and the video that I always reference is here, so check it out if you are interested in that type of thing.

First Release

Release Announcement

Today I released v0.00.001 of Chronicles of Tright: Isles of Arden.  It’s a stretch to call this anything like a game at this point.  It’s really just boilerplate code and a starting point for future development.  It was also a chance for me to test out some procedures for packing the code base up into a release and publishing it.  But it is a starting point and I’m weirdly excited to put out something so terrible.  You can move the character around with WASD.  Collision detection works and I’m using my own custom collision detection and response system.  The collision box around the one house on the map is intentionally oversized and the art assets are intentionally bad as they are just placeholders.  That’s really about it.

My idea here is to make numerous incremental releases on a quick schedule.  I’ve tried this before and had some success with it so I’m going this route again.  Once I get to the server side coding it may be more difficult to make such rapid changes but that’s a world I’m going to need so much work on that I’ll just cross that bridge when I get to it.  I obviously have many, many, MANY things to do before this is even close to a playable game, but I’m going to try and keep the additions for each release small and attainable.  So, for v0.00.002 I need to implement:

  • Mouse controls that allow you to zoom, rotate, and change the pitch of the camera
  • Keyboard controls for strafing
  • Fix the collision box on the current house and add one more object to the world

That’s a small list that I can hopefully get done in a few days.  I’ll then do another release and evaluate what features to add from there.

New Project

Planning and Development

It’s MLK day in the US.  I have a couple of things I’m starting today but a big one is a new project here.  I’ve never made it far with games I’ve tried to make here in the past.  Well, that’s not fair.  I’ve actually made quite a bit of progress on past projects it’s just never translated into much that end users can actually see.  My goal with this project is to get something that is playable published ASAP and make incremental improvements over time.  So, with all that being said here’s the new project.

It’s a multiplayer 3d browser game.  I’m very short on details right now but I want the art style to be bright and low-polygon, and I want the game to be funny.  I will probably start with brand new lore.  So no humans, elves and dwarves.  Well, no elves and dwarves anyway.  I guess there will be humans.  I’m actually not exactly sure yet.  I’ll spend the rest of February designing gameplay and the world.  I have what I think is a really interesting idea to do turn-based combat in a multiplayer environment, so hopefully that will turn out.

My deadline is MLK day 2023.  That’s January 16th, 2023.  I want to have a basic, playable game published on or before that date.  That’s an optimistic goal but the best time for optimism is the start of a new year and the start of a new project, right?