Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (777)
Games in Android Showcase (231)
games submitted by our members
Games in WIP (856)
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  
  ExFate : sen. Classic Platformer 2D game without using popular game engine  (Read 1094 times)
0 Members and 1 Guest are viewing this topic.
Offline hadezbladez
« Posted 2018-11-15 12:23:09 »

Hey Guys!
This is my first post and its about publication of my first game.

I Couldn't believe it at first. Java is really capable making a game without any popular game engine.
I want to share some of my story about how i make this game but i couldn't get it right.
So if u guys want to ask some question about it. Im gonna answer it in this post

You guys can check it here :
https://h1g-hadezbladez.itch.io/exfate-sen

Offline ral0r2
« Reply #1 - Posted 2018-11-15 13:50:17 »

What unpopular engine did you use? Smiley
Offline Gornova
« Reply #2 - Posted 2018-11-15 20:25:14 »

well done so far! I'm not sure about the tutorial.. I mean attack using which key exactly?
Graphic is nice and a gravity is fine, solid foundation for a platformer.

Btw: an option to mute music in game? Is boring after a while..

Blog | Last game Drone Swarm
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline hadezbladez
« Reply #3 - Posted 2018-11-16 00:24:44 »

@ral0r2 No game engine  Huh

@Gornova
You can attack enemy when you already level 2 its because it doesnt have anything to attack enemy
there is some neat button on fourth and fifth level its called mute button because the music is too hypnotic and when im working on it im getting dizzy just by hearing it over and over again  Lips Sealed
(is this thing a spoiler? I put a hint on fourth level there is a mute button)

Yeah the game is boring
1. no camera shake for more epicness
2. java arraylist were useful but at the sametime it has a drawback that can lag the game and i couldnt find a solution about that
Offline cylab

JGO Kernel


Medals: 188



« Reply #4 - Posted 2018-11-16 08:52:02 »

@ral0r2 No game engine  Huh
Topic: ExFate : sen. Classic Platformer 2D game without using popular game engine
@ral0r2: What unpopular engine did you use? Smiley  Pointing

2. java arraylist were useful but at the sametime it has a drawback that can lag the game and i couldnt find a solution about that
What exactly is your problem? Did you profile your code (using VisualVM or something)?

Mathias - I Know What [you] Did Last Summer!
Offline VaTTeRGeR
« Reply #5 - Posted 2018-11-16 10:07:47 »

You could show us the code that you suspect slows your game down. Arraylist is heavily optimized, it'll be very fast if you use it correctly.
Offline hadezbladez
« Reply #6 - Posted 2018-11-16 13:48:56 »

@cylab
i still dont know. Sometimes, my game cause a little lag and noticable maybe i use too many for loops for spawning particle
but i still dont know is it really the cause or something

@VaTTeRGeR
heres my code gameengine >> http://pastebin.java-gaming.org/507ce277d5b16
heres my code at levela1 >> http://pastebin.java-gaming.org/07ce73d7b561d

I hope you can understand it. because it still a big mystery on why java can cause sudden lag
feel free to ask even more or roast that code  Grin
Offline VaTTeRGeR
« Reply #7 - Posted 2018-11-16 16:08:10 »

I didn't experience any lag whatsoever.
That is on an i5-2520M w/ dog slow integrated Intel HD 3000 graphics, 8gig ram and an SSD.

My eyes are still burning from looking at that code but what i can tell you is:
  • Get rid of all System.gc() calls.
  • Clean up your code a bit whole f**king lot. Spacing, indentation, ...

I can't find anything particularly sinful in there and your use of Arrayslist seemed fine tbh.
I noticed you use ArrayList.trimToSize() a lot and also inside tight loops, that's unnecessary (you don't gain any speed and maybe a few kilobytes of memory) but what you are doing with the ArrayLists shouldn't kill your performance.

Just avoid constantly resizing and creating stuff, better pre-allocate a larger array, even if it wastes a few kilobyte in most situations.

If you think collision detection (Iterating over all items in your level) is killing your performance you can use techniques like spatial-partition: http://gameprogrammingpatterns.com/spatial-partition.html

This is especially easy and efficient with a 2d tile based game.
Offline hadezbladez
« Reply #8 - Posted 2018-11-16 18:12:57 »

@VaTTeRGeR
Thank you for your attention and your coding advice.  Cool

if java have automatic garbage collect system why am i still bother about system.gc()
- I did this because loading some assets and i was nulling all of my assets i would gain some speeds. but it didn't do anything relevant to my lag problems.
So the code was just dumped there

Collision detection was the hardest for me to understand that. So i didnt care about memory back there.
i did focus about bug in there and i call it jumping pogo stick madness.
that wasn't nice experience but i survived and gave me some big laugh about there when i drop a pillar
I guess thats the joy of game programmer   Grin
Pages: [1]
  ignore  |  Print  
 
 

 
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!