Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (522)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (590)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Untitled - 2D side scroller  (Read 5010 times)
0 Members and 1 Guest are viewing this topic.
Offline hvince95

Junior Devvie


Medals: 1
Projects: 2



« Posted 2012-12-07 05:24:47 »



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.
Offline GabrielBailey74
« Reply #1 - Posted 2012-12-07 05:57:20 »

Tried running it, got:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
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 . . .

 Sad

Offline hvince95

Junior Devvie


Medals: 1
Projects: 2



« Reply #2 - Posted 2012-12-07 06:11:31 »

Don't even need that anyway, for the moment.  Try again, the new jar is up and ready to go!
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Vladiedoo
« Reply #3 - Posted 2012-12-07 06:23:31 »

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)?
Offline thanatos1

Senior Newbie





« Reply #4 - Posted 2012-12-07 16:55:27 »

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/
Offline GabrielBailey74
« Reply #5 - Posted 2012-12-07 20:51:37 »

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

Offline thanatos1

Senior Newbie





« Reply #6 - Posted 2012-12-07 21:25:01 »

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
Online HeroesGraveDev

JGO Kernel


Medals: 292
Projects: 11
Exp: 3 years


┬─┬ノ(ಠ_ಠノ)(╯°□°)╯︵ ┻━┻


« Reply #7 - Posted 2012-12-07 21:55:01 »

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  Smiley

Offline hvince95

Junior Devvie


Medals: 1
Projects: 2



« Reply #8 - Posted 2012-12-07 23:43:46 »

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 Cheesy, 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)?
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.
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!)
Offline RobinB

JGO Ninja


Medals: 44
Projects: 1
Exp: 3 years


Spacegame in progress


« Reply #9 - Posted 2012-12-07 23:54:05 »

Looks nice.
Maybe you should prerender textures a little further from screen, because these mine lag spikes show some tearing at the sides sometimes.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Online HeroesGraveDev

JGO Kernel


Medals: 292
Projects: 11
Exp: 3 years


┬─┬ノ(ಠ_ಠノ)(╯°□°)╯︵ ┻━┻


« Reply #10 - Posted 2012-12-07 23:59:23 »

-snip-
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!)

Use dropbox or a similar site.

You get 2GB at dropbox for free.  Grin

I WANT TO PLAY THIS!!  Pointing  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)

Offline hvince95

Junior Devvie


Medals: 1
Projects: 2



« Reply #11 - Posted 2012-12-09 04:14:17 »

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!
Offline PeterNicholson

Senior Devvie


Medals: 3
Projects: 1



« Reply #12 - Posted 2012-12-11 15:22:30 »

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

Subscribe to me on YouTube: http://youtube.com/javaprogrammerguy
Offline Mac70
« Reply #13 - Posted 2012-12-11 15:27:06 »

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.

Check out my Devblog! Smiley
Offline PeterNicholson

Senior Devvie


Medals: 3
Projects: 1



« Reply #14 - Posted 2012-12-11 16:06:07 »

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

I get the same bug. Also you shoud consider making the brush a bit bigger...  Smiley

Subscribe to me on YouTube: http://youtube.com/javaprogrammerguy
Offline Mac70
« Reply #15 - Posted 2012-12-11 16:07:41 »

Also you shoud consider making the brush a bit bigger...  Smiley

Or "pixelated" to help players in making constructions. Wink

Check out my Devblog! Smiley
Offline PeterNicholson

Senior Devvie


Medals: 3
Projects: 1



« Reply #16 - Posted 2012-12-11 16:16:36 »

FOUND NEW BUG: When I "paint" blocks behind the player, under ground, the game freezes!  Huh

Subscribe to me on YouTube: http://youtube.com/javaprogrammerguy
Offline hvince95

Junior Devvie


Medals: 1
Projects: 2



« Reply #17 - Posted 2012-12-12 12:44:17 »

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 Smiley, 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!
Offline RobinB

JGO Ninja


Medals: 44
Projects: 1
Exp: 3 years


Spacegame in progress


« Reply #18 - Posted 2012-12-14 18:14:54 »

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
Offline hvince95

Junior Devvie


Medals: 1
Projects: 2



« Reply #19 - Posted 2012-12-15 00:01:44 »

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.
Offline RobinB

JGO Ninja


Medals: 44
Projects: 1
Exp: 3 years


Spacegame in progress


« Reply #20 - Posted 2012-12-15 08:56:50 »

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.

I have implemented  the first option in 2 projects of mine, it is not really hard, but a lot of calculations.
Diffrent animations would always look odd i think (always some degrees off), and get really annoying if you create more entitys, because they all require these extra animations.
Besides, you wont only have one way slopes, but also holes like these (dont mind the character and the fact it does not have legs haha):


So calculating the position is maybe hard to do, but once you have done it, you wont have to worry about it for the rest of the project anymore.
Offline hvince95

Junior Devvie


Medals: 1
Projects: 2



« Reply #21 - Posted 2012-12-15 23:54:19 »

It just about looks like you've got this same problem sorted out yourself, eliminate the legs alltogether!  Doing this right the first time and not having to worry about it for the rest of the project is something I really want to do.  I have started on skeletal leg animations, I'll post the new project here in a few days once they are looking good.
Offline __iCode__

Senior Newbie





« Reply #22 - Posted 2012-12-25 05:16:57 »

Runs fine for me on Windows 8. The only thing that I would suggest is to try and limit the build height or the maximum height that the character can go as you can position the mouse underneath the characters sprite and hold the up button and you can jump to an infinite height...

Also maybe change the block size or character's size as I find that balancing on one single block is not natural, maybe just play around with sizes or something.

P.S. I had a consistent 60 FPS Cheesy
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

trollwarrior1 (31 views)
2014-11-22 12:13:56

xFryIx (72 views)
2014-11-13 12:34:49

digdugdiggy (51 views)
2014-11-12 21:11:50

digdugdiggy (45 views)
2014-11-12 21:10:15

digdugdiggy (39 views)
2014-11-12 21:09:33

kovacsa (63 views)
2014-11-07 19:57:14

TehJavaDev (68 views)
2014-11-03 22:04:50

BurntPizza (66 views)
2014-11-03 18:54:52

moogie (81 views)
2014-11-03 06:22:04

CopyableCougar4 (81 views)
2014-11-01 23:36:41
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!