Untitled - 2D side scroller

A game I’ve been woring on for the past couple weeks, looking to take terraria (minus the magic cr*p) and shrink down the tile size to make it feel more real. Name suggestions please!

To Do:

  • Saving and loading of chunks
  • Flowing finite water

Change Log:
[9/12/12]

  • Improved game loop. Much smoother with interpolation while rendering. Thankyou theagentd!
  • Added placing and removing grass blocks with left and right click.

[12/12/12]

  • Chunk offset added. This shifts the border for the loading of chunks wider (can change in config.txt, default is 100 pixels) to prevent nasty black lines and visible tears off the screen.
  • Can no longer place blocks under player (if you spawn in the dirt, exit the game and start again!)
  • Added a proper player sprite (ripped from terraria for the moment) with directional movement
  • Can walk up slopes of a maximum of 2 tiles high without jumping

Downloads:
Not sure if compatible with OSX or Linux, have uploaded any if someone wants to test
Get the jar(s) here:
windows
macosx
linux

Controls:
Cannot currently do much, just walk around jump, and place blocks, but much more is coming.

  • WSD - walk left and right and jump
  • Left Click - Place dirt blocks
  • Right Click - remove block (place void)

I hope to have some sort of story line, but instead of exploring across, explore up (campaign will be on an island), but an option for infinite width since it is supported (read on). At this stage, chunks (128x128 tiles, 256x256 pixels) are loaded and unloaded as you walk. The small amounts of ‘blur’ you get at the edges of the screen when moving around is the chunks unloading and loading again, I must change the distance out a little further so this isn’t noticable Done! I am on the brink of implementing loading and saving of chunks when exiting the app. The world is generated using perlin noise. Player movement and collisions are pixel perfect. The config file changes the screen width and height, and an option for vSync and/or sleeping the game loops thread to save system resources, chunk offset can also be set.

Tried running it, got:



C:\Users\Rig\Desktop>java -jar island.jar
Display could not be created
org.lwjgl.LWJGLException: No support for WGL_ARB_multisample
        at org.lwjgl.opengl.WindowsPeerInfo.nChoosePixelFormat(Native Method)
        at org.lwjgl.opengl.WindowsPeerInfo.choosePixelFormat(WindowsPeerInfo.java:52)
        at org.lwjgl.opengl.WindowsDisplay.createWindow(WindowsDisplay.java:229)

        at org.lwjgl.opengl.Display.createWindow(Display.java:303)
        at org.lwjgl.opengl.Display.create(Display.java:845)
        at org.lwjgl.opengl.Display.create(Display.java:754)
        at src.main.Main.<init>(Main.java:34)
        at src.main.Main.main(Main.java:128)

C:\Users\Rig\Desktop>pause
Press any key to continue . . .

:frowning:

Don’t even need that anyway, for the moment. Try again, the new jar is up and ready to go!

The .jar works for me and runs from 900-1000fps.

EDIT: Out of curiosity, how are you storing and then rendering the noise (different colors on mountain)?

is the mountain meant to be like this?

all i did was walk left for a while, and suddendly the mountain took this shape.

http://postimage.org/image/h4fc4r7gt/

Thanks thanatos, I was going to upload the same picture, just 2 bumps to the left :wink:

I thought i was reaching Hell or something, but one of the bumps were so big my jump speed wasn’t enough to cross it, so i was stuck.

I am VERY dissapointed!!!1

I’m on Linux here and it didn’t work. I checked it with Ark, and the Linux natives were missing. Could you please include the Linux Natives.

Thanks :slight_smile:

Thanks for all the interest everyone. The ‘hellish’ terrain to the left is an error with the perlin noise (I don’t know what is causing this), I can fix it by shifting the whole map to the left a few trillion pixels :D, but I will find out what is wrong with the perlin noise at some stage.

[quote]Out of curiosity, how are you storing and then rendering the noise (different colors on mountain)?
[/quote]
As I said, there are many chunks (128 tiles square). Dirt does have a fixed colour, but when rendering the world each element (r, g, and b) is added with ± 10 (colour range is 0-255). I think this makes the game a little more interesting.

[quote]I’m on Linux here and it didn’t work. I checked it with Ark, and the Linux natives were missing. Could you please include the Linux Natives.
[/quote]
The natives for each machine are around 1.5mb. Javagaming’s max file size is 2mb. I could always upload 3 seperate files of mac, linux, and windows. I’ll get onto that for the next update (its not in the right state at the moment!)

Looks nice.
Maybe you should prerender textures a little further from screen, because these mine lag spikes show some tearing at the sides sometimes.

Use dropbox or a similar site.

You get 2GB at dropbox for free. ;D

I WANT TO PLAY THIS!! :point: :persecutioncomplex:

Hopefully this turns out Awesome. I love Terraria, but the small things (like the game loop) were terrible and it was like everything was just thrown in the box without thought to whether it belonged.

(EDIT: Name Suggestion: Airarret :persecutioncomplex:)

Updated a few things:
Firstly the biggest. The whole game loop was redone. Previously I had logic updating as fast as possible, and the option to render alongside updating, or seperately at 60fps. As you all probably know, this didn’t really work too well. Now, the logic runs at a constant frame rate (50fps for simple timing in the future), and rendering is done as fast as possible with linear interpolation. I think this approach is much better, thanks to theagentd among others for this!

Please note, there is no saving or loading of chunks at this time! If you place dirt somewhere and walk it off the screen, the world will regenerate that chunk as the default heightmap.

‘W’ ‘A’ ‘D’ to move
left click to place block
right click to remove block

open jar file with 7zip and edit config file, disable vSync for max fps!

Hey!
I have just started up virtual box (hosted on windows 7 64-bit), and switched on ubuntu 12.10. Youre game workes fine. :slight_smile:

I found a bug - when you place blocks on your character and press jump, you will be literally launched into space. More block = bigger jump. :wink:

Terrain generation works fine, but I think it should generate more flat areas. Sometimes I can see world generation.

I get the same bug. Also you shoud consider making the brush a bit bigger… :slight_smile:

[quote=“PeterNicholson,post:15,topic:40365”]
Or “pixelated” to help players in making constructions. :wink:

FOUND NEW BUG: When I “paint” blocks behind the player, under ground, the game freezes! ???

Update!
A few additions, nothing major. From the first post:

  • Chunk offset added. This shifts the border for the loading of chunks wider (can change in config.txt, default is 100 pixels) to prevent nasty black lines and visible tears off the screen.
  • Can no longer place blocks under player (if you spawn in the dirt, exit the game and start again!)
  • Added a proper player sprite (ripped from terraria for the moment) with directional movement
  • Can walk up slopes of a maximum of 2 tiles high without jumping

Would appreciate it if people continue to test on mac and linux :), thankyou PeterNicholson.

I am not sure where I will go with the players sprite. On flat ground it works really well, but when he gets on a slope, only one point of his toe is touching the ground. I am yet to implement saving and loading, and I think finite water is a long way off!

The new .jar’s are up!

Nice work,
These slopes are going to be an bitch, you probably need to create some skeletral animation for that (drawing legs / feets seperately).
Good luck with it :wink:

Haha, I know. Since the last update, I’ve been at a standstill. Its either the skeletal animations, or a series of different animations for walking up different sloped hills (at the moment I’m thinking this one, but if I can implement skeletal animations that would probably look much better). The next update might not be for a while, but will most likely include one of these two methods.