Jump to page: 1 2 3
Thread overview
D game engine -- Any suggestions?
Nov 20, 2013
Mineko
Nov 20, 2013
ponce
Nov 20, 2013
simendsjo
Nov 20, 2013
Paulo Pinto
Nov 20, 2013
Rene Zwanenburg
Nov 20, 2013
Rene Zwanenburg
Nov 20, 2013
Paulo Pinto
Nov 20, 2013
Mineko
Nov 20, 2013
Mineko
Nov 20, 2013
Mike Parker
Nov 20, 2013
Mineko
Nov 20, 2013
Henning Pohl
Nov 20, 2013
Geancarlo Rocha
Nov 20, 2013
Mineko
Nov 20, 2013
Paulo Pinto
Nov 20, 2013
Mineko
Nov 20, 2013
Franz
Nov 20, 2013
Mineko
Nov 20, 2013
Paulo Pinto
Nov 21, 2013
qznc
Nov 22, 2013
Mineko
Nov 23, 2013
Rene Zwanenburg
November 20, 2013
Yo, I'm starting off a new game engine designed around D, and I just wanted to know if some of you might be kind enough to review some of my base code and tell me if I need to change anything in it.. While it's small. ;_;

I'm still learning D, I quite like it, the power of C++ in some parts, and the ease of Java in others. (Good job Walter!)

Anyway here, check it out, only ones you really need to pay attention to are main.d, time.d, and input.d.

https://github.com/ICGCC/Breaker-3D-Game-Engine

Thanks for helping out a newbie, and if you want to contribute to it, even better!

..That and if I'm using the GPL right. >_____>"
November 20, 2013
On Wednesday, 20 November 2013 at 07:48:21 UTC, Mineko wrote:
> Yo, I'm starting off a new game engine designed around D, and I just wanted to know if some of you might be kind enough to review some of my base code and tell me if I need to change anything in it.. While it's small. ;_;
>
> I'm still learning D, I quite like it, the power of C++ in some parts, and the ease of Java in others. (Good job Walter!)
>
> Anyway here, check it out, only ones you really need to pay attention to are main.d, time.d, and input.d.
>
> https://github.com/ICGCC/Breaker-3D-Game-Engine
>
> Thanks for helping out a newbie, and if you want to contribute to it, even better!
>
> ..That and if I'm using the GPL right. >_____>"

- Well for a start, 600 lines of license headers is a bit too much. You can just refer to your license file in a two-line header (+copyright).

- PI is defined in std.math

- a class is public by default unless noted otherwise, unlike Java

November 20, 2013
On Wednesday, 20 November 2013 at 07:48:21 UTC, Mineko wrote:
(...)
> ..That and if I'm using the GPL right. >_____>"

Do you really plan on using 677 lines per file on the license header..?
November 20, 2013
On Wednesday, 20 November 2013 at 07:48:21 UTC, Mineko wrote:
> Yo, I'm starting off a new game engine designed around D, and I just wanted to know if some of you might be kind enough to review some of my base code and tell me if I need to change anything in it.. While it's small. ;_;
>
> I'm still learning D, I quite like it, the power of C++ in some parts, and the ease of Java in others. (Good job Walter!)
>
> Anyway here, check it out, only ones you really need to pay attention to are main.d, time.d, and input.d.
>
> https://github.com/ICGCC/Breaker-3D-Game-Engine
>
> Thanks for helping out a newbie, and if you want to contribute to it, even better!
>
> ..That and if I'm using the GPL right. >_____>"

You don't need to include the full GPL license in each file. Look here for an example.

https://github.com/pjmlp/queue-d

Don't use the legacy OpenGL functions. Fixed pipeline is dead.

--
Paulo
November 20, 2013
On Wednesday, 20 November 2013 at 07:48:21 UTC, Mineko wrote:
> Yo, I'm starting off a new game engine designed around D, and I just wanted to know if some of you might be kind enough to review some of my base code and tell me if I need to change anything in it.. While it's small. ;_;
>
> I'm still learning D, I quite like it, the power of C++ in some parts, and the ease of Java in others. (Good job Walter!)
>
> Anyway here, check it out, only ones you really need to pay attention to are main.d, time.d, and input.d.
>
> https://github.com/ICGCC/Breaker-3D-Game-Engine
>
> Thanks for helping out a newbie, and if you want to contribute to it, even better!
>
> ..That and if I'm using the GPL right. >_____>"

Hi,

A few things jumped out at me:

Camera.d:

- The use of x, y, z and rx, ry, rz. These should really be in some vector struct. Since you're using Dub, you can easily use gl3n [1][2]. While it's still pretty basic, should be more than enough to get you started.

- Use Quaternions to store your rotations instead of euler angles.

- You can use @property instead of trivial getters and setters

- You may want to store your camera matrices in the camera class, and pass them to OpenGL when rendering. These matrices can be useful, and you don't want to use glGet* functions ever if you care about performance ;). gl3n provides matrix structs and facilities to create projection matrices and the like.

Oops, I have to run.. Will take a look at the rest later.

[1] http://dav1dde.github.io/gl3n/index.html
[2] http://code.dlang.org/packages/gl3n
November 20, 2013
On Wednesday, 20 November 2013 at 09:15:41 UTC, Rene Zwanenburg wrote:
> Hi,
>
> A few things jumped out at me:
>
> Camera.d:
>
> ...
>
> Oops, I have to run.. Will take a look at the rest later.

Still regarding camera.d:

- The glfw3 import appears to be unused and can be removed.

- the call to Math.perspectiveGL modifies OpenGL state. Your math functions _really_ shouldn't interact with OpenGL.

- Taking the previous point a bit further, your Camera class doesn't need to know about OpenGL either. In your rendering routine, get the camera matrices from a camera and pass them to OpenGL.

- Like Paulo said, don't use the fixed function pipeline. If you're not familiar with 3D yet the FFP is easier to use at first, but using modern OpenGL will pay for itself in the long run. I don't know where to find a good introduction to modern OpenGL though, perhaps someone else around here..

- rotate, move are unnecessary. Once you switch to gl3n, move becomes:
camera.position += someVector;
Same thing with rotate, only you multiply:
camera.rotation *= someQuaternion;


math.d:

- D allows free functions. There's no need to use hacks like completely static classes. You can remove the Math class and put it's functions in the module.

- I'd also make std.math a public import, so you only have to import your math to get both in another module.

- perspectiveGL doesn't belong here, but this is fixed by using gl3n.


time.d

- Same thing with the statics as in math. Though personally I'd call Time Timer, and make instances. You'll probably want to have more than one timer.

- Sleeping doesn't belong in the timer. It should only calculate total running time and delta time in update. Later on you'll probably find out it needs more features, but these two will be fine for now. If anywhere, sleeping belongs in the game loop. That being said I'd advise against sleeping at all. It's usually better to use vsync, or run at max fps if the user disables it.


That's all I could find during a quick peek.. If you'd like me to clarify some of these points, please don't hesitate to ask!
November 20, 2013
On 11/20/2013 4:48 PM, Mineko wrote:

>
> Thanks for helping out a newbie, and if you want to contribute to it,
> even better!
>

You don't need to list derelict-util as a dependency in your package.json. The other Derelict packages already depend on it so it will be pulled in anyway.

November 20, 2013
Wow!

You guys are really helpful, I wouldn't have thought about a lot of that, I'll pounce on all of this right after breakfast! Thanks! :D
November 20, 2013
Feel free to take a look at https://github.com/hpohl/ext/. Maybe you can find something useful.
November 20, 2013
You should fix your LICENSE following these instructions http://www.gnu.org/licenses/gpl-howto.html. I hope you understand the virality of GPL and why most people won't touch your code for real work.


On Wednesday, 20 November 2013 at 07:48:21 UTC, Mineko wrote:
> Yo, I'm starting off a new game engine designed around D, and I just wanted to know if some of you might be kind enough to review some of my base code and tell me if I need to change anything in it.. While it's small. ;_;
>
> I'm still learning D, I quite like it, the power of C++ in some parts, and the ease of Java in others. (Good job Walter!)
>
> Anyway here, check it out, only ones you really need to pay attention to are main.d, time.d, and input.d.
>
> https://github.com/ICGCC/Breaker-3D-Game-Engine
>
> Thanks for helping out a newbie, and if you want to contribute to it, even better!
>
> ..That and if I'm using the GPL right. >_____>"
« First   ‹ Prev
1 2 3