Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (107)
games submitted by our members
Games in WIP (536)
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  
  NEngine - Nishu Game Engine  (Read 3947 times)
0 Members and 1 Guest are viewing this topic.
Offline opiop65

JGO Kernel


Medals: 153
Projects: 7
Exp: 3 years


JumpButton Studios


« Posted 2013-10-27 06:08:18 »



This is my latest project, NEngine, or Nishu Game Engine. Its my pet project for the next month or so, and after that it will be put to use to create a game for christmas for my girlfriend! Its purpose is to be flexible, yet fast, high level, and graphically appealing. Currently I have support for:

-Spritesheets
-Texures
-Creating basic primitives
-Immediate mode & display lists
-Coloring
-Screens and changing screens
-Basic camera

I started the library yesterday (10/26/2013), so I unfortunately didn't have time to set up advanced code like VBOs and shaders. That's on my to-do list. I will be keeping deprecated code as the aim of the engine is to provide you with flexible code, not just modern styles. It will be a 2D library strictly, unless I really want to give 3D a go. I have already set up a small demo, but its nothing more than a moving rectangle. The library is approximately 10% finished (by my advanced calculations! Smiley ), so I will not be uploading a test version for a few days!

What I want to have done

-Textures, spritesheets, advanced image manipulation
-Easy animator
-Shader support
-Advanced rendering techniques (modern opengl)
-GUI
-Support for all kinds of file types
-Maybe basic networking
-Other stuff I can't think of right now

Here is the demo, which creates a square in immediate mode, colors it and moves it using the camera:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
62  
63  
package com.nishu.tree;

import static com.nishu.nengine.base.graphics.GL11.*;

import java.util.Random;

import com.nishu.nengine.base.Game;
import com.nishu.nengine.base.graphics.camera.Camera;
import com.nishu.nengine.base.graphics.color.Color4f;
import com.nishu.nengine.base.graphics.geom.Shape;
import com.nishu.nengine.utilities.Screen;

public class Tree extends Screen {

   private static Game game;
   private Shape shape;
   private Camera camera;

   Random rand;

   @Override
   public void initGL() {
   }

   @Override
   public void init() {
      camera = new Camera(game.getWidth(), game.getHeight());
      shape = new Shape();

      rand = new Random();
   }

   @Override
   public void update() {
   }

   @Override
   public void render() {
      clearScreen();
      camera.translate(rand.nextInt(20) - 10, rand.nextInt(20) - 10);
      pushMatrix();
      begin();
      shape.createColoredSquare(new Color4f(0, 0, 1, 0), game.getWidth() / 2, game.getHeight() / 2, 32);
      end();
      popMatrix();

   }

   @Override
   public void resized() {
   }

   @Override
   public void dispose() {
   }

   public static void main(String[] args) {
      game = new Game("Tree", 1280, 720, 60);
      game.addMainScreen(new Tree());
      game.start();
   }

}

Offline rv3392

Senior Member


Medals: 2
Projects: 1
Exp: 5 years


Programmer | Modder | Gamer


« Reply #1 - Posted 2013-10-27 06:33:19 »

Just wondering what happened to your chunks etc. Remember the ones you were talking to me about.
Offline opiop65

JGO Kernel


Medals: 153
Projects: 7
Exp: 3 years


JumpButton Studios


« Reply #2 - Posted 2013-10-27 06:47:30 »

Ah yes, I've iced that project for now. I was starting to write really crappy code, and I needed to take a step back for a few months. Plus, I have to write a game library, a world/block editor tool and then a game all before Christmas for my girlfriend! I'm in a crunch right now Smiley

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline saucymeatman
« Reply #3 - Posted 2013-11-04 01:49:22 »

Hey cool engine!   Smiley
Love the logo.
I would change the "base" to "core" however, its alot more standard.
Offline opiop65

JGO Kernel


Medals: 153
Projects: 7
Exp: 3 years


JumpButton Studios


« Reply #4 - Posted 2013-11-04 02:26:36 »

Yeah well its not my standard Wink

Offline thunderfist123

Senior Newbie





« Reply #5 - Posted 2013-11-07 04:25:29 »

Whoa, this is cool! Did you make balanced energy using this library? Your game looks cool!
Offline opiop65

JGO Kernel


Medals: 153
Projects: 7
Exp: 3 years


JumpButton Studios


« Reply #6 - Posted 2013-11-18 05:01:26 »

So, I haven't updated the engine in a while, and that's partly because I encountered some frustrating bugs early on that I couldn't solve for some reason. I decided to start again, and I re-did the whole thing. I decided to change it up a bit, and focus on more modern OpenGL primarily, but I'll allow the user to dig into the old OpenGL code, but the functions won't be as high level. I want to design the engine to allow flexibility, yet provide high level code so anyone can create a simple game in a matter of hours. I plan on accomplishing this by providing a massive array of functions for every class, allowing the user to have choice about what to use, but still have it easy enough to use so that anyone can understand. I'm designing it so that the user shouldn't have to touch low level OpenGL functions unless they absolutely need to, and its going good so far.

What should I add in to the library to make it stand out from others? I want to mention that first and foremost I want to get the basic spritebatcher done. I want to create a geometry library that will allow the user to quickly create objects with predefined shapes.

Offline 65K
« Reply #7 - Posted 2013-11-18 17:49:26 »

I plan on accomplishing this by providing a massive array of functions for every class,
Don't.
Except you want confusing interfaces, ###### off users, god-like classes and extra work while maintaining.
Achieve flexibility by combining clean, small classes and objects that were designed to the point and not overloaded.

Offline opiop65

JGO Kernel


Medals: 153
Projects: 7
Exp: 3 years


JumpButton Studios


« Reply #8 - Posted 2013-11-18 23:43:53 »

Well, of course. I wouldn't make the user actually deal with the methods. I (and I already have started this) plan on making the engine high level so no one has to touch low level code. I should've said that I want to make functions that will automatically allow the user to easily create the type of game they want, and the engine will handle all the underlying programming involved in that. Some engines are more advanced used orientated, and those aren't the people I want to target. I'll throw in some extra wrapper classes for advanced shader usage, custom rendering techniques etc...

Offline opiop65

JGO Kernel


Medals: 153
Projects: 7
Exp: 3 years


JumpButton Studios


« Reply #9 - Posted 2013-11-19 04:59:55 »

Here's the repo, everyone feel free to tell me what I'm doing right so far, what I'm doing wrong, and anything you would change! My main fixation right now is the sprite batcher, I want to make sure that's done correctly. I haven't done a ton yet, but I just want to make sure it's all solid before I move on.

https://github.com/nishugames/NEngine

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Online Agro
« Reply #10 - Posted 2013-11-19 05:48:16 »

Hm, what's the difference between an engine and a library? It seems like all these "engines" that have been posted lately need to be included into your project, or library. Wouldn't an engine be where you have a base, and then you import resources? I suppose though it can go both ways? :/ Shouldn't an engine should be a sole executable with resource files everywhere, am I wrong?

Offline ctomni231

JGO Wizard


Medals: 98
Projects: 1
Exp: 7 years


Not a glitch. Just have a lil' pixelexia...


« Reply #11 - Posted 2013-11-19 05:57:54 »

Game Engine vs. Game Library

Long story short... there is a LOT of gray area on what separates the two.

Offline opiop65

JGO Kernel


Medals: 153
Projects: 7
Exp: 3 years


JumpButton Studios


« Reply #12 - Posted 2013-11-19 11:28:39 »

In my opinion you're completely right, but NEngine sounds better than NLibrary or NLib!

Online Drenius
« Reply #13 - Posted 2013-11-19 17:10:11 »

Why not NGine?

Imo a library is a bunch of utils while an engine attempts to be something like the 'master' of the program and it is less easy to replace.

But this seems to be something you have to decide for yourself.
Offline opiop65

JGO Kernel


Medals: 153
Projects: 7
Exp: 3 years


JumpButton Studios


« Reply #14 - Posted 2013-11-19 23:05:28 »

I'm torn between trying to create a full put engine and just a library of graphical, shader and buffer utilities. I think I know enough to actually make an engine, but it will have lots of dependencies on the old stack matrix and some deprecated buffer functions. I just don't know enough math to utilize my own matrices yet! Plus, my goal of making the "engine" so high level that the average user never has to touch OpenGL directly is going to be hard to accomplish as I'll need wrappers for everything. I have a hard time staying dedicated to projects Sad

As for NGine, it doesn't roll as nicely as NEngine off the tongue. I think NEngine sounds kind of weird and funny, which I like!

Offline saucymeatman
« Reply #15 - Posted 2013-11-20 02:17:49 »

NGine and NGE would be my favorite ways to refer to the project. NEngine is hard for me to say in my head...
Great project though, whatever you choose to call it. Cheesy
Online Agro
« Reply #16 - Posted 2013-11-20 02:21:43 »

I take NGine as being pronounced engine so that sounds pretty cool to me

Offline opiop65

JGO Kernel


Medals: 153
Projects: 7
Exp: 3 years


JumpButton Studios


« Reply #17 - Posted 2013-11-20 02:56:21 »

Well, NGine is cool, but I really do like NEngine. I think I pronounce it different than everyone else and that's why I like it so much!
Quote
Great project though, whatever you choose to call it.
Thank you, that means a lot!

Offline opiop65

JGO Kernel


Medals: 153
Projects: 7
Exp: 3 years


JumpButton Studios


« Reply #18 - Posted 2013-11-20 04:51:44 »

Quick update, I decided I'm going to turn this project into more of a collection of utility classes. I just don't have the need right now to create a full out engine (or library!), so I'm just going to write small classes and throw them into the project. Anyone can then go in and utilize them however they like, I feel this is more useful for me at least, because I generally don't like programming in engines. I seem to do better with more open style libraries, and this really does it for me!

Online HeroesGraveDev

JGO Kernel


Medals: 238
Projects: 11
Exp: 2 years


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


« Reply #19 - Posted 2013-11-20 05:01:47 »

Quick update, I decided I'm going to turn this project into more of a collection of utility classes. I just don't have the need right now to create a full out engine (or library!), so I'm just going to write small classes and throw them into the project. Anyone can then go in and utilize them however they like, I feel this is more useful for me at least, because I generally don't like programming in engines. I seem to do better with more open style libraries, and this really does it for me!

Yes. This is such a good way to do things.
Too many libraries you just want for one or two things but require everything else as well.

Plus it becomes easier to learn from the code since you don't har to dive into a web of other irrelevant library components.

Best of all it makes it extremely easy to avoid the 'too-many-options' syndrome most bug librarie have where they try to cover edge cases but in he end make confusing APIs and fail the edge cases anyway. Let the user figure out their own edge cases and KISS.

Offline opiop65

JGO Kernel


Medals: 153
Projects: 7
Exp: 3 years


JumpButton Studios


« Reply #20 - Posted 2013-11-20 05:14:59 »

Definitely! That's the whole reason I only used LibGDX once or twice; it just wasn't flexible enough for me and I hate not knowing exactly what everything does. A utility library seems to suit me well because you can abstract them and do whatever you want with them. I don't need to pass in a texture as a parameter for that sprite because I can create a new constructor that doesn't require a texture. You simply just can't do that in engines that don't support it. I can quite honestly say I think I'm done with engines unless I absolutely need them because a teacher says I do or a job says I need to. I just don't like using code I haven't written!

I await the people who will bash on me for not taking the easy way out of things Cheesy

Offline opiop65

JGO Kernel


Medals: 153
Projects: 7
Exp: 3 years


JumpButton Studios


« Reply #21 - Posted 2013-11-21 04:59:10 »

Huge update!

I decided to turn this into a utility library instead of an engine. So, here's my first update of the new library. Please note that some of the code I'm using I've taken from other people over the years. Basically, code hoarding. It's temporary until I decide to re-write it, but oh well.
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
Changelog:
------------
Now have:

Camera (interface for easy creation of different types of cameras)

Camera3D (as the name implies, this camera, which implements Camera, is a 3D camera

Color4f (Small color class, nothing special besides pre-made primary colors)

ErrorHandler (the start to my errorhandler class, just prints out statements and will later allow the creation of custom Java errors)

GameLoop (Utility class (dependent upon Time.class) that creates, and runs, a gameloop at a fixed FPS rate. Still needs a little work (pausing and resuming)

Model (Small utility class that holds vertex and normal information for a model)

ModelFace (Small utility class that creates new model face out of triangles)

OBJLoader (Loads an .obj file and is dependent upon Model and ModelFace)

ResourceManager (took the general idea of this class from wessles' engine (sorry!), it holds hashmaps that store data. I added support for adding in your own custom hashmaps, so you aren't stuck with my hard coded ones. Still need to work on it a little and add more stock maps.)

Screen (implements ScreenObject, its an abstract class that holds methods for things such as initialization, rendering updating and disposing. Required by the GameLoop class)

ScreenObject (interface that holds the above mentioned methods, nothing special)

Shader (Reads and stores into memory a vertex and fragment shader. Need to update some more)

ShaderProgram (Dependent upon Shader.class, creates and allows for the usage and deletion of shaders. Need to add the ability to push uniforms, that's coming soon!)

SpriteBatch (Large class, only half complete, that batches geometry together for rendering. It utilizes VBOs and VAs to render static geometry and dynamic geometry, respectfully.)

Texture (Utility class to load and bind textures. Only half done)

Time (Small utility class that gets the current time and handles the delta)

Vector2f (Two dimensional vector. All the math is complete!)

Vector3f (Same as above just three dimensional and with more complex math)

Window (Static utility class that creates, updates and destroys the current OpenGL/Window context. Still need to add support for different display modes and other stuff.)


So, that was a huge list (Looks significantly smaller when actually looking at! it, oh well!) I'll probably release the first version once the sprite batcher is finished, so maybe in a few days. For now, here's the repo to go look at all the code! Sorry, its very undocumented!

NEngine

The current code is under GLUtils! Any suggestions are greatly appreciated!

Offline opiop65

JGO Kernel


Medals: 153
Projects: 7
Exp: 3 years


JumpButton Studios


« Reply #22 - Posted 2013-11-22 04:13:53 »

I wanted to show off a little, so I decided to create a new program that has a 3D camera in place, a game loop that lets you limit the FPS and a Window. I was able to do this all in 45 lines of code (not including the extra spaces and imports)! I'm pretty happy with it, and I can further reduce the amount of lines by wrapping all the low level OpenGL functions into a separate class.  Here's the example code:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
62  
63  
64  
65  
66  
67  
68  
69  
70  
71  
package com.nishu.idk;

import static org.lwjgl.opengl.GL11.*;
import static org.lwjgl.util.glu.GLU.gluPerspective;

import org.lwjgl.input.Keyboard;
import org.lwjgl.opengl.Display;

import com.nishu.utils.Camera;
import com.nishu.utils.Camera3D;
import com.nishu.utils.GameLoop;
import com.nishu.utils.Screen;
import com.nishu.utils.Window;

public class Main extends Screen{
   
   public static final int WIDTH = 1280;
   public static final int HEIGHT = 720;
   
   private GameLoop loop;
   private Camera camera;
   
   public Main(){
      loop = new GameLoop();
      loop.setScreen(this);
      loop.start(60);
   }

   @Override
   public void init() {
      camera = new Camera3D.CameraBuilder().setAspectRatio((float) Display.getWidth() / Display.getHeight()).setRotation(0, 0, 0).setPosition(0, 0, 0).setFieldOfView(67).build();
      camera.applyProjection();
   }

   @Override
   public void initGL() {
      glViewport(0, 0, Display.getWidth(), Display.getHeight());
      glMatrixMode(GL_PROJECTION);
      glLoadIdentity();
     
      gluPerspective((float) 67, WIDTH / HEIGHT, 0.001f, 1000f);
      glMatrixMode(GL_MODELVIEW);
     
   }

   @Override
   public void render() {
      glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
      glClearColor(0, 0, 0.75f, 0);
      glLoadIdentity();
      camera.applyTranslations();
   }

   @Override
   public void update() {
      camera.updateMouse(1, 90, -90);
      camera.updateKeys(32, 1);
      if(Keyboard.isKeyDown(Keyboard.KEY_ESCAPE)){
         loop.stop();
      }
   }
   
   @Override
   public void dispose() {
   }
   
   public static void main(String[] args){
      Window.createWindow(1280, 720, "IDK3D", false);
      new Main();
   }
}


And a little update on the spritebatcher; Its pretty much finished, I just need to add color and texture support. Furthermore, I need to remove any dependencies (or allow you to not use the class with any dependencies) on the other classes in the library. Should be pretty easy to do!

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.

CogWheelz (7 views)
2014-07-30 21:08:39

Riven (20 views)
2014-07-29 18:09:19

Riven (13 views)
2014-07-29 18:08:52

Dwinin (12 views)
2014-07-29 10:59:34

E.R. Fleming (32 views)
2014-07-29 03:07:13

E.R. Fleming (12 views)
2014-07-29 03:06:25

pw (42 views)
2014-07-24 01:59:36

Riven (42 views)
2014-07-23 21:16:32

Riven (29 views)
2014-07-23 21:07:15

Riven (30 views)
2014-07-23 20:56:16
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
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!