Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (741)
Games in Android Showcase (225)
games submitted by our members
Games in WIP (823)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1] 2
  ignore  |  Print  
  Red Game 2D Engine (redone!)  (Read 30035 times)
0 Members and 1 Guest are viewing this topic.
Offline matanui159

JGO Coder


Medals: 11
Projects: 1
Exp: 10-12 months


Aww... So cute...


« Posted 2014-09-22 05:08:16 »



I have recently been redoing my 2D game engine as there where many problems with it... But this one is much better (I swear persecutioncomplex )...

I haven't got any demo or pictures (except the one above) but I will be working on that...

FEATURES: https://github.com/matanui159/Red-Game-2D-Engine/blob/master/README.md#features
SOURCE CODE: https://github.com/matanui159/Red-Game-2D-Engine

Any positive feedback will be great, any negative feedback will be helpful...
If you find any problems, I will attempt to fix them to the best of my ability...

Sorry it is not much yet... at the moment it is only a simple renderer, entity system, sound system and input system along with a set of utilities...

Thx in advance...

Is it sad that I still get a fright when the computer beeps at me...
Offline matanui159

JGO Coder


Medals: 11
Projects: 1
Exp: 10-12 months


Aww... So cute...


« Reply #1 - Posted 2014-09-22 22:22:50 »

Can I please get some feedback on this? I really need it at this point...

Is it sad that I still get a fright when the computer beeps at me...
Offline Brynn

JGO Wizard


Medals: 103
Projects: 3
Exp: 1 month or less


JGO's Spiffy Duchess


« Reply #2 - Posted 2014-09-23 22:16:08 »

Technical info and one picture is hardly enough to give feedback on  Pointing

To get the actual link of a picture in dropbox, replace the www. with dl., and put that in the img tags. So instead of

1  
[img]www.dropbox.com/s/urmil2ulyx59gt0/poly%20file.png?dl=0[/img]

do
1  
[img]dl.dropbox.com/s/urmil2ulyx59gt0/poly%20file.png?dl=0[/img]


Example:


Welcome to a new kind of tension
All across the alienation
Where everything isn't meant to be okay
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline matanui159

JGO Coder


Medals: 11
Projects: 1
Exp: 10-12 months


Aww... So cute...


« Reply #3 - Posted 2014-09-23 23:51:14 »

I fixed the images...
What more information do you want?
I just want feedback on the ideas...
I don't want to release anything yet although I might release it later for people to mess around with...

Is it sad that I still get a fright when the computer beeps at me...
Offline Ecumene

JGO Kernel


Medals: 195
Projects: 4
Exp: 8 years


I did not hit her! I did not!


« Reply #4 - Posted 2014-09-24 00:00:39 »

A few questions,
Is there a public source code repository?
What renderer are your using, Java2D, OpenGL, JavaFX ...? My bad, didn't read that part of the post
Can I have the source to your text rendering class, I was thinking of implementing that into my engine.

Thanks in advance!

Offline Cero
« Reply #5 - Posted 2014-09-24 00:05:34 »

Java experience:   10-12 months
Coding experience:   2 years

and you are writing an engine ?
GOOD experienced programmers use and rely on engines, so the engine should be top notch

It's just hard to be supportive, even if you do a great job all things considered...

Offline Ecumene

JGO Kernel


Medals: 195
Projects: 4
Exp: 8 years


I did not hit her! I did not!


« Reply #6 - Posted 2014-09-24 00:11:16 »

and you are writing an engine ?
GOOD experienced programmers use and rely on engines, so the engine should be top notch

It's just hard to be supportive, even if you do a great job all things considered...

experience != knowledge. People rely on engines, yes. But that doesn't mean it has to be 100% bug-free and completely polished. This could be just a little engine he's making to test his programming knowledge. He's probably not expecting it to make the new Call of Duty.

Either way, I can't really give feedback without the source code.

EDIT; Also OP, use [.img width=X] to resize a picture, (800 is great).

Offline matanui159

JGO Coder


Medals: 11
Projects: 1
Exp: 10-12 months


Aww... So cute...


« Reply #7 - Posted 2014-09-24 07:52:29 »

I will release the source code soon on Github but for security sakes I want to have a license on it first...
I'm not really good with this part (too much stuff complicated stuff... why can't things be like the DBAD licence... Smiley )... All I want is a general license which states that people cannot make it their own... Does anyone have any suggestions?

Also, I would want to release this when it is finished along with my website I am working on... I don't really care if it gets popular but I will use it for my 2D games and maybe in the future I'll make a 3D game engine...

One more thing...
Can I have the source to your text rendering class, I was thinking of implementing that into my engine.
I don't think you would want my text rendering class... It is very bad because instead of rendering all the letters of a font onto an image (which is faster and what your supposed to do)... I just render the text itself onto an image...

I will fix the images...

Thx for the feedback

Is it sad that I still get a fright when the computer beeps at me...
Offline matanui159

JGO Coder


Medals: 11
Projects: 1
Exp: 10-12 months


Aww... So cute...


« Reply #8 - Posted 2014-09-24 08:05:01 »

Also, just a note... the 'CODE SNIPET' image above is not a code snipet of the game engine but a code snipet of the test game (GENERAL PICTURE) I made in the engine to show an idea of how it works...

But for a better idea... here is a simple program:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
import rg.core.Sprite;
import rg.core.World;
import rg.input.Input;

public class Main {
   public static void main(String[] args) {
      World.add(new Player());
      World.start();
   }
   public static class Player extends Sprite {
      private static final long serialVersionUID = 0;
      public Player() {
         super("img/player/red.png");
      }
      public void start() {
         set(World.getWidth() / 2, World.getHeight() / 2);
      }
      public void update() {
         turn(Input.getAxis("left", "right") * 300);
         move(0, -Input.getAxis("down", "up") * 500, angle);
         loop(-100, World.getWidth() + 100, -100, World.getHeight() + 100);
      }
   }
}


This program turns the ship using the left and right arrow keys and moves the ship using the up and down arrow keys then loops it around the screen...

Any questions? Just ask and I shall answer...

Is it sad that I still get a fright when the computer beeps at me...
Offline matanui159

JGO Coder


Medals: 11
Projects: 1
Exp: 10-12 months


Aww... So cute...


« Reply #9 - Posted 2014-09-24 11:52:07 »

I found this very helpful website and I think I might chose the GPL v3 license...
Again, I don't really know much about this so some help would be nice...

But, help or no help, I'll release the code through github under that license (or another one if I change my mind) tomorrow...

Is it sad that I still get a fright when the computer beeps at me...
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline matanui159

JGO Coder


Medals: 11
Projects: 1
Exp: 10-12 months


Aww... So cute...


« Reply #10 - Posted 2014-09-25 03:27:08 »

Source code released!
https://github.com/matanui159/Red-Game-2D-Engine

Plz give feedback

Thx in advance...

Is it sad that I still get a fright when the computer beeps at me...
Offline saucymeatman
« Reply #11 - Posted 2014-09-25 17:42:16 »

Ie
Here are some pictures:
GENERAL PICTURE:


DEBUG AND GRAPHER:


POLY FILE:


CODE SNIPET (extending and overriding Sprite class (see below)):





General Idea:
  • There is a 'World' class (static class) which is where everything goes.
  • You override the 'Sprite' class and add it to the world.
  • When an event happens (like someone joining your server), the world will use Java reflection to call a certain method (like 'netAccepted(ClientController)') on all the sprites. If the method returns an error, it will display the error. If the method doesn't exist, it won't care.
  • The good thing with using reflection is that other people can add their own events and just add the methods to all the sprites which they want to catch the event.


Fist impressions :
- Camera is a Sprite, which is confusing to me
- Reflection is not neccesary to have an events system
- Having a static world class "where everything goes" is bad because it makes decoupling different components of a game very difficult.
Offline matanui159

JGO Coder


Medals: 11
Projects: 1
Exp: 10-12 months


Aww... So cute...


« Reply #12 - Posted 2014-09-26 01:26:08 »

Ie
Here are some pictures:
GENERAL PICTURE:


DEBUG AND GRAPHER:


POLY FILE:


CODE SNIPET (extending and overriding Sprite class (see below)):





General Idea:
  • There is a 'World' class (static class) which is where everything goes.
  • You override the 'Sprite' class and add it to the world.
  • When an event happens (like someone joining your server), the world will use Java reflection to call a certain method (like 'netAccepted(ClientController)') on all the sprites. If the method returns an error, it will display the error. If the method doesn't exist, it won't care.
  • The good thing with using reflection is that other people can add their own events and just add the methods to all the sprites which they want to catch the event.


Fist impressions :
- Camera is a Sprite, which is confusing to me
- Reflection is not neccesary to have an events system
- Having a static world class "where everything goes" is bad because it makes decoupling different components of a game very difficult.


The camera is a sprite which doesn't draw anything... I just like using sprites because that is the core of the engine...
I'm using reflection for the events system to call the methods in the sprites (if they exist)...
You can group sprites by changing the 'name' attribute of the sprite and getting all of the sprites with a certain name using:
World.getAll(<name>);

Is it sad that I still get a fright when the computer beeps at me...
Offline Opiop
« Reply #13 - Posted 2014-09-26 02:03:11 »

The camera sprite idea is honestly a terrible design choice. A sprite, by definition:
"a computer graphic that may be moved on-screen and otherwise manipulated as a single entity."

The camera is NOT  sprite, and should not be allowed to behave like a sprite. The camera is a special component; its not an entity or a sprite. Its not rendered, and in fact it doesn't do any of the rendering. The camera is simply a way to determine what is, and what isn't inside the frustum and projecting vertices onto the screen using matrix math. Cameras do not move, there is no such thing as a camera. The geometry moves within the window.

I agree with saucymeatman when he says having a static world is a bad decision. There's no issue with having the user create a world object. A static implementation just confuses everything and makes stuff way more complicated then it should be.

Honestly? I think your library needs a lot of work to make it more user friendly, and you need to research design templates. There's a reason programmers use the same code templates, they work well and do their job.

I also have an issue with getting components using a string. There's just something very wrong about that, use getters.

Keep it up though! Don't expect a lot of feedback from such an early version of your library though. People already have the libraries they need, breaking into the game engine/library market is hard unless you are very good at your job.
Offline matanui159

JGO Coder


Medals: 11
Projects: 1
Exp: 10-12 months


Aww... So cute...


« Reply #14 - Posted 2014-09-26 02:21:58 »

The sprite is something which does something, it does not need to draw anything
I named it a sprite because the only other two names I could think of were:
- Object, which is already in Java
- GameObject, which would sound like I am copying Unity

So I named it sprite...

Also, my main idea for this engine is similar like Game Maker (or other engines), where you tell an object what to do and it will do it when you add it, but in a code kind of idea..

It probably won't become that major but I still like the idea of it and I find it easier then other engines...

Is it sad that I still get a fright when the computer beeps at me...
Offline Opiop
« Reply #15 - Posted 2014-09-26 02:27:22 »

I'm trying to tell you there are standards and terminology for the stuff you are doing.

I know this is a personal project, but if you ask for advice and throw your library out there, then you have to use the correct terminology so everyone knows what you are talking about. Creating a camera from a Sprite base class makes absolutely no sense in the game development world.

You say you don't to name it GameObject because you are going to sound like you are copying Unity, I say that's a silly thing to worry about. Don't worry about what other libraries or engines name their classes or else you will never have names for anything.

Do research on the correct terminology before doing anything else, and restructure your library so that the camera is not a child object of Sprite. I mean, come on you draw the player with the Sprite class. How does that even make sense? Player and Camera extending from the same base class? They share almost none of the same functionalities.
Offline matanui159

JGO Coder


Medals: 11
Projects: 1
Exp: 10-12 months


Aww... So cute...


« Reply #16 - Posted 2014-09-26 04:02:19 »

I can see where u r coming from, I agree that it doesn't make sense...

But other than that one problem, how do u think it is?

Is it sad that I still get a fright when the computer beeps at me...
Offline klaus
« Reply #17 - Posted 2014-09-26 09:02:45 »

- Reflection is not neccesary to have an events system
Agree.

I thought the same when reading:
Quote
The good thing with using reflection is that other people can add their own events and just add the methods to all the sprites which they want to catch the event.
Number one (or two?  Wink ) rule in programming: don't reinvent the wheel. If you have an idea how to do stuff I would recommend to first do an intense online search that could match the concept you were thinking about. Often you will encounter some great library that does exactly that what you wanted to achieve. I've been there many times.

So maybe for your event system you could just use Google's EventBus? Always try to minimize the complexity of your own code.

For feedback to your code: I just scanned a few of your classes on GitHub. Overall they look clean and nicely documented. I can't give feedback on the implemented logic at this time. I didn't try out the engine, but I would recommend you put up some tech demos for people to easily look at. (Or do you have already and I didn't see them?)

Ad "sprite" debate: Just name it "entity"  Wink Everything can be an entity. And the component-entity-event approach (http://en.wikipedia.org/wiki/Entity_component_system)  is something I personfits most games the best.

All the best for your engine! I hope I could give some good input.
Offline matanui159

JGO Coder


Medals: 11
Projects: 1
Exp: 10-12 months


Aww... So cute...


« Reply #18 - Posted 2014-09-26 09:52:12 »

I don't like other libraries unless I have no idea how to make one...
That is why I made a game engine and, in my opinion, I thought it went pretty well...
But that is why I don't really search up that kind of stuff to find another person's library...
Anyways, some people say this is the number one rule in programming and others say that is the number one rule in programming... Ie, my number one rule in programming is 'K.I.S.S. (keep it simple stupid)'...

But thx for the feedback and I might change it from 'Sprite' to 'Entity'

EDIT: no I don't have any tech demoes (other than those pictures, but that isn't that much of a game) but I may make some in the future...

Is it sad that I still get a fright when the computer beeps at me...
Offline klaus
« Reply #19 - Posted 2014-09-26 10:14:57 »

Hey I didn't want to sound like I'm the one who knows the "one true path". I'm sorry if I put it accross this way.

I also put this " Wink" because I know it is not THE number one rule. For me personally I think it is a good rule. I like your KISS approach. It's also a really important one I believe. Another great rule that is definitely in my top 10 or even top 5: DRY (don't repeat yourself) Strictly following this principle saves you a lot of time in the future (especially when you are maintaining your code later on)

But one more thing about writing everything on your own: Good libraries (used by a lot of users, long living) usually went through lots and lots of iterations where bugs got fixed, performance got improved and so on. If you decide to implement a well-known concept on your own you will end up fixing a lot of bugs, improving performance, ... - energy that other people have already invested.

Also if you are using the JDK, you already use a lot of other people's implementations and libraries.  Wink

But I do believe that you should do what you think is best.
Offline matanui159

JGO Coder


Medals: 11
Projects: 1
Exp: 10-12 months


Aww... So cute...


« Reply #20 - Posted 2014-09-26 10:26:27 »

I know that other things are bug free, but something like calling a method using reflection doesn't really have that many bugs...

Also, I did note out that I like too make my own if I can and something like JDK isn't really something I can do...

Finally, I wasn't trying to make u sound like (and I quote [literally])...
the one who knows the "one true path".
It is just that with text, u can't really hear the tone of their voice. Someone could just point something out and people might think they are angry...

Again, thx for the feedback...

Ps. Yes, I do put a lot of '...'s everywhere... I'm not being creepy, exaggerated or anything else, I just do it a lot for some reason... I don't know why tho... ... ... ... ...

Pps. Another one of my fav rules which I made up is 'make it fast or make a loading bar'... In other words, make something happen fast or give the user something which tells them it will take a while. This is more of applications rather then games but it is still good to remember

Is it sad that I still get a fright when the computer beeps at me...
Offline matanui159

JGO Coder


Medals: 11
Projects: 1
Exp: 10-12 months


Aww... So cute...


« Reply #21 - Posted 2014-09-27 04:58:49 »

Just a few extra notes here...

I have renamed the 'Sprite' class to 'Entity' (Thx to klaus for the idea) but the new version isn't on github yet...

I am going to finish the jBox2D implementation (still have to add joints), add controller support and direct drawing and my engine should be finished (unless I decide to add better anti-aliasing support)...

I was looking at the three points by saucymeatman and all of them have been discussed except the one about having world:
I made the 'World' class static because that is also the Display for LWJGL and the dynamics World for jBox2D...

When LWJGL updates I may add the ability of having multiple worlds (or windows)...

Is it sad that I still get a fright when the computer beeps at me...
Offline Brynn

JGO Wizard


Medals: 103
Projects: 3
Exp: 1 month or less


JGO's Spiffy Duchess


« Reply #22 - Posted 2014-09-27 13:24:06 »

The amount of rants I have done on this forum are tremendous, regardless people have already said their recommendations; opiop, saucymeatman, and all the people above in this thread. Opiop is totally right, there are standards for this kind of thing, and even though its for personal use, I found it was very hard to read some of your code just because the terminology confused me.

Also, Reflection is pretty BAD. EDIT: Just look at the things below.

Citation:
http://stackoverflow.com/questions/37628/what-is-reflection-and-why-is-it-useful
http://stackoverflow.com/questions/6870769/what-is-the-problem-with-reflection

Besides that, it looks pretty good.  Grin

Welcome to a new kind of tension
All across the alienation
Where everything isn't meant to be okay
Offline matanui159

JGO Coder


Medals: 11
Projects: 1
Exp: 10-12 months


Aww... So cute...


« Reply #23 - Posted 2014-09-27 22:52:12 »

But what else am I supposed to use other than reflection?
Do count in the fact that I want the ability for other people to create events and it seems simple to just have the events as methods in the Entity object itself...

There isn't any problems with runtime explosions because if it cannot find the method it will just ignore it and continue on... Then people can check if that method is being called (if it is not working) by using 'System.out.println(<some stuff here>)' at the start of the method...

Also, there isn't actually any lag so that isn't a problem...

Finally, can we stop talking about the 'terminology'? I have changed the name from sprite to entity...

Is it sad that I still get a fright when the computer beeps at me...
Offline orange451

JGO Kernel


Medals: 346
Projects: 6
Exp: 6 years


Your face. Your ass. What's the difference?


« Reply #24 - Posted 2014-09-28 01:10:41 »

Instead of Reflection for your events, you could make your own customizable event listener

http://stackoverflow.com/questions/6270132/create-a-custom-event-in-java

First Recon. A java made online first person shooter!
Offline matanui159

JGO Coder


Medals: 11
Projects: 1
Exp: 10-12 months


Aww... So cute...


« Reply #25 - Posted 2014-09-28 07:30:23 »

But then others cannot 'easily' make events and also I just find it easy having event listeners as methods inside the entity...

In my mind, if there isn't any problems then there is no point arguing about it or changing it... And I find no problems with reflection...

Is it sad that I still get a fright when the computer beeps at me...
Offline matanui159

JGO Coder


Medals: 11
Projects: 1
Exp: 10-12 months


Aww... So cute...


« Reply #26 - Posted 2014-12-22 01:02:27 »



This is my redo of my game engine because my old one was quite horrible... I have no pictures to show except the one above... But I will get straight to that... The same is with a demo (haven't got [a proper] one yet, but I will be working on it)...

But I have the source here: https://github.com/matanui159/Red-Game-2D-Engine
And I have the current features here: https://github.com/matanui159/Red-Game-2D-Engine/blob/master/README.md#features

Sorry it is not much... My game engine ATM is only a simple renderer, entity system, sound system and input system...

Any response positive would be great... any response negative will be helpful...
If you find any problems, I will try to fix them as best as possible...

Thx in advance...

EDIT: does anybody know the preview picture size so I can fix up the logo?

Is it sad that I still get a fright when the computer beeps at me...
Offline Mr.CodeIt

Senior Devvie


Medals: 2
Projects: 1



« Reply #27 - Posted 2014-12-22 01:08:37 »

Wouldn't this be considered spam? What was wrong with the previous "Engine", couldn't you have just changed the picture (if that's what you did here)?
Offline matanui159

JGO Coder


Medals: 11
Projects: 1
Exp: 10-12 months


Aww... So cute...


« Reply #28 - Posted 2014-12-22 01:21:08 »

Well... because this one was done from scratch and the last one already had alot of talk about how horrible it was I thought it would've been better to create a new topic... Anyways:
Quote
Each new publication by a member will discard the previous publication of that member

That is from the "WIP Publication Reel"...

Is it sad that I still get a fright when the computer beeps at me...
Offline Mr.CodeIt

Senior Devvie


Medals: 2
Projects: 1



« Reply #29 - Posted 2014-12-22 01:43:34 »

Well... because this one was done from scratch and the last one already had alot of talk about how horrible it was I thought it would've been better to create a new topic...

Don't get bothered by any criticism that may seem harsh. Your tech demo looks great based off of what I've seen.
Pages: [1] 2
  ignore  |  Print  
 
 

 
Ecumene (108 views)
2017-09-30 02:57:34

theagentd (135 views)
2017-09-26 18:23:31

cybrmynd (245 views)
2017-08-02 12:28:51

cybrmynd (240 views)
2017-08-02 12:19:43

cybrmynd (238 views)
2017-08-02 12:18:09

Sralse (254 views)
2017-07-25 17:13:48

Archive (864 views)
2017-04-27 17:45:51

buddyBro (1008 views)
2017-04-05 03:38:00

CopyableCougar4 (1568 views)
2017-03-24 15:39:42

theagentd (1373 views)
2017-03-24 15:32:08
List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05

SF/X Libraries
by SkyAphid
2017-03-02 06:38:56

SF/X Libraries
by SkyAphid
2017-03-02 06:38:32

SF/X Libraries
by SkyAphid
2017-03-02 06:38:05

SF/X Libraries
by SkyAphid
2017-03-02 06:37:51
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!