royk: sandbox type game

not a rip off of terrarria, I swear! nor of minecraft... nor of infiniminer...

jac at 20:35 on 12 Nov 13
So I wanted a world you could edit down to the pixel, but which was also "infinite". So I started on a little game the other day. Actually doing it pixel-by-pixel sucks most of the time, so digging is done in a cone shape, and placing is a circle. Plans are to have other edit shapes, and have any rectangular shape you want for placing (assuming you have the materials).

Some gifs of the progression so far:

Initial version, showing warping and digging.
Show content

V2, now with gravity and collision:
Show content

V3, now with a little guy and practical placing (up until this point it was place 1 pixel at a time):

(Solshine made the little guy sprite, which I have not correctly centered, so his legs sink into the ground. Thanks for the assist, Sol!)

I've been making windows binaries for Solshine to play with, you can test them out too:
(if you do try it, let me know if I left out a dll or something... windows is stupid, eh :p
-- crashing if you go off screen or near the bottom corner is currently natural because I'm such an excellent coder)

To come, infinite worlds, world saving/loading, other materials, inventory, natural landscapes, beautiful changes in materials/dirt color, water, items, crafting, ...
Edited at 23:59 on 12 Nov 13 by jac
Streak at 20:49 on 12 Nov 13
oooo i like it
jac at 23:58 on 12 Nov 13
Thanks! I've just posted the zip file I've been making for Solshine, if you'd like to test it out. I'll tell you the controls pretty much suck though, and there's not a whole lot to do as of yet.
F_Budgie at 01:19 on 13 Nov 13

jac you should check out mischief which also has infintie world but also infinite levels of zoom (it's a drawing program but maayyyy be relevant?
Cacapulse Banned at 03:14 on 13 Nov 13
At first I was going "wat" about that suggestion to check out mischief but then I realized this is basically a drawing program isn't it. In game form! This has all sorts of untapped potential.

F_Budgie at 08:25 on 13 Nov 13
but mischief is also infinite with maximum zooming, although the difference is mischief is vector and this game is consciously about pixels
jac at 13:57 on 13 Nov 13
Huh, that's funny; I've been wanting to make an infinite paper/infinite zoom program ever since I got my tablet, but never got around to it. Cool to see there's already stuff out there like what I was planning.

Some level of zoom will probably be good in this project, since if you really do want pixel level accuracy you'll need to blow it up. Maybe that'll be a skill or an ability or something. Or perhaps you'll have to craft a magnifying glass, who knows!

If you actually want to draw in game, then the idea of terrain differentiation I had wouldn't really work. Basically, I was thinking that when the world generated it could naturally change and look all pretty, but if you wanted to put dirt back down it would take a lot of effort for it to not look like a solid brown blob. The fix I thought of was to encode small variations in the display of materials into the coordinate of the block. So painting dirt over a large area would naturally have small changes that make it look like cartoon dirt rather than MSPaint dirt. Sort of the principal behind this.
Cacapulse Banned at 14:34 on 13 Nov 13
I am suddenly reminded of Line Rider. whoa jesus what happened to that site
bonzairob at 23:16 on 13 Nov 13
Probably just random variations in HSL within a tiny amount would be enough, although it would look like noise. For more natural-looking shapes, it's always good to throw sine/cosine/tangent in there, somehow.
jac at 01:14 on 14 Nov 13
I'm hoping I can just do it in RGB and avoid the conversions (and extra work :p). Tangent! Since when are sawtooths natural?

I quickly hacked in infinite worlds (until you run out of memory and crash), here's a gif of that:

(I hacked up the dig speed to make the tunneling look pretty and then messed up somewhat at the start heh :p)

It's late now, but I'll make a build of it and update the OP tomorrow.
F_Budgie at 03:55 on 14 Nov 13
stopped working as soon as i started runnign it for no reason

i'm on windows 7
AndrewFM at 11:00 on 14 Nov 13
Hey jac, here's a little trick I devised for making circular-based line drawing tools not look like shit:

Edited at 11:18 on 14 Nov 13 by AndrewFM
jac at 12:33 on 14 Nov 13
F_Budgie: can you explain a little more? It just stopped updating the screen/redrawing the edit cone or did it actually crash? Did you dig or place anything before it stopped? If it didn't completely crash, can you see if it happens again and tell me if it's using up a bunch of CPU in the task manager? In the currently uploaded version there are several issues with going near the edges/off the screen.

AndrewFM: Wow, hat's a very detailed explanation, thanks! :) The current place system was partially because it enforced a limit on how much you could place per unit of time (since supposedly you're human), and because the place radius is so small that actually drawing a large image would be a pain in the ass anyway. I think I'll probably implement a "god mode" where you can just scroll around and draw anywhere, and that would probably do some interpolation plus cleanup with something like a Kalman filter (maybe something simpler) since mouse input is so noisy.

In other news, I kind of want to add multiple races and character classes and make it into a more full blown RPG. This will probably just end up as a dumping ground for various things I've been wanting to play with :p
F_Budgie at 12:41 on 14 Nov 13
by crash i mean "royk.exe has stopped working" instantly, and then i have to close the program or search online for a solution, which just closes the program
jac at 15:30 on 14 Nov 13
Well, my first thought is that it can't find the guy image since I made sure it crashes if it can't load it, but it could be a number of things. I'll investigate, and include some logging in the next version so I can properly debug things like this.
23:03 on 16 Nov 13
Alrighty, here's an update (I just pointed the same URL as the OP to the new version)

This updates brings infinite worlds (until you crash from an out of memory error), and map saving/loading.

Now, if something goes wrong there should be a file named royk.log in the folder you ran royk.exe from (please keep all the files/DLLs together). Hopefully it will say what's wrong. If it crashed before being able to create the log, hopefully it will say so in stderr.txt, otherwise we're screwed :p If you need to report a bug, please include both files (if they exist), just to be sure.

I don't think I mentioned the controls before:
  • AD / AE (dvorak): movement
  • W / < (dvorak): jump
  • Left click: activate current tool (dig if or place)
  • 1: switch to digger
  • 2: switch to placer
  • m: save map file
  • Right click: warp player to mouse position
By default, the map will be saved to the cleverly named "themap.roykm". To load a map, you'll have to run royk.exe from the console, and specify the map name as the second argument. A GUI for this is coming. If you specified a map to load, it will also save back to that map. If you try to specify a blank map by giving it a filename that doesn't exist, it will error out (note to self: TODO).

The titlebar now displays the current player location, which "tile" they're on, and how many "chunks" there are (why I flip-flopped between "tile" and "chunk" I'll never know...). Also, when you save it'll say "SAVED" for a second or two or until you start editing the world again.

In the rare case that it can't find avatar.png, it will display only a black screen with a title saying it couldn't find it.

I just remembered that I left the dig speed crazy high from testing. Well, have fun jumping up and digging straight down into oblivion.

Edit: Oh yeah, there is a visual glitch at the edge of tiles sometimes which makes a 1pixel wide straight white line to show up even through dirt. Please don't report that, I know about it :p
Edited at 23:05 on 16 Nov 13 by jac
F_Budgie at 02:44 on 17 Nov 13
there now it works

anyway to contorl the speed of cone digging
02:49 on 17 Nov 13
you can get infinite bouncing somehow like i was digging my way out and i think i double pressed space? but now i've got infinite bouncing, but before i wasn't jupming at all
02:50 on 17 Nov 13
it stopped when i pressed w again and i don't know how to replicate it
jac at 02:52 on 17 Nov 13
Haha, well if the bug comes back hopefully it'll be diagnoseable through the log. Edit: That wasn't about the infinite jumping, but the insta-crashing. Like, it jumped up in the air over and over without touching the ground? Or was it like the 'w' key was held down still?

No way to control dig speed yet, I'm afraid. There's a small possibility that Solshine will tackle implementing a simple toolbar (otherwise I will) and once that's done I'll put a few different speed (and possibly shape) diggers in there.
F_Budgie at 05:46 on 17 Nov 13
it was sort of like it was on a pogo stick. as soon as it hit the ground, it was like i'd hit w just at the right moment. when i dug down, it was like falling down an infinity abyss. infinite jumping remained on right click warp too. i was doing a lot of clicking and i may have switched diggers at the same time too
jac at 17:14 on 21 Nov 13
I'll add something to periodically recheck key states. If you see it happen again, try just jumping once to see if it fixes it.

@Streak has made some lovely sprites of which I am now using one incorrectly :p Dig animation is coming, but here's a screenshot showing text rendering, health, fall damage (and death), and the new guy running around. I think a larger sprite compared to the blocks (since they're staying at pixel-sized) will make a lot of stuff easier.

We had a bit of discussion in IRC about bosses and various game mechanics, such as the inventory. That stuff is coming soon! Also, I'll probably add a "snap to block" mode, so you can dig/place like terraria/minecraft, since that model does work pretty well. I'll make a new build this weekend whether any of that is done or not.