Java 3D Game Development 39: Component Based Architecture

preview_player
Показать описание
3D Opengl Game development log videos with commentary about my indie Java RPG game.

This week I worked on restructuring the entity hierarchy in the code to use a component based architecture.

The game is written in Java, and uses LWJGL and the Opengl API.

Music:
Kevin MacLeod - "Wallpaper"
Рекомендации по теме
Комментарии
Автор

I really like seeing the behind the scenes stuff. I'm learning to program my self, and its great to see how someone with experience approaches problems. I love these updates and would love to see more code in the future. Thanks for the videos!

jojomoman
Автор

you're a fricking majician I'd say! The refactoring is hard af, but you nailed it THAT GOOD!

NiKiTjA_OFF
Автор

The restructuring of your code is insanely awesome! You're definitely on the right way! As always, I'm looking forward to your next video. Thanks you :)

johnnyvandenelzen
Автор

Im making a 2D engine in Java and I've started hearing alot about Entity Component Systems lately but nobody gave an explanation about what it was or even remotely how to implement it but your video was great at that so props to you :)

AlecGirman
Автор

I feel like this "component based architecture" is similar to how the Unity game engine manages objects in the scene, in which you can add "rigid body component" or "collider component" to objects.

buffetize
Автор

Seriously this whole game in pure java and whole equillinox in pure Java, ofc you have lwjgl, but it still feels like its from scratch. Keeping all this code work together is just awesome. You are a genius when you do all

PROJECTJoza
Автор

I come from the video: "Equilinox - Java Game Devlog 8: Colourful Entities" thank you for your reference!! :)

Ferenc-Racz
Автор

Thank you +ThinMatrix for your video. I am going to link to this video from the tutorial for our Entity-Compnoent-System-based game engine written in Go (named Engo), because your video explains the usefulness of entities and components so well :-).

etiennebruines
Автор

Cool! I've started using the Artemis Entity System Framework for my past few games.

CustardGamesYT
Автор

Do you have any plans on doing a tutorial to make the component based architecture?

root
Автор

Well done! Looking forward to the next video :)

Joern
Автор

Yo Thin, nice job on every tutorial and devlog so far, i've seen them all and are always waiting for new stuff I can learn from you.
I've been implementing a similar entity-component system myself but the more things I want the components to do, the more messy my code becomes. I read somewhere on the internet that the best practice to making a component-entity system is to seperate the rendering code from the components, so that the rendering engine could compile even if you have no components in your project. I implemented components like RenderingComponent, which has a reference to the masterrenderer, and everytime it updates, it sends a texturedModel and the loc/rot/scale to the MasterRenderer. the texturedModel and the loc/rot/scale are stored in a map on the masterRenderer to draw. This works fine but when I started to implement the light as a component and the camera as a component, things started to get messy in my MasterRenderer. Is this also the case with you and am I just being nitpicky about my code? or are you doing things another way.
Thanks and regards and keep coding my friend ;)

susverwimp
Автор

you sir are amazing... thanks for this...

sandmn
Автор

I really like this video. I'm subscribed to your channel for videos related to the more code-related part of game development and I appreciate videos like this where you explain the code.

superbanana
Автор

Your previous structure looked a lot like Minecrafts :).

It would be cool if you created a development IDE instead of a jFrame, that way you can add componants and everything, as well as program our own things in. Kind of like JMonkey but everything will be built off what your game supports.

John-jbfw
Автор

Wow great job and fantastic video! My entity system is getting pretty messy too and this has given me a couple ideas for how to fix that. I think that I'll still keep the whole inheritance structure, but put a bunch of methods into the overall entity class like collision, health, combat, etc. Then I could just call these in the different entities' update methods.

CRAZEERUSKEE
Автор

What do you do if you want to access the component? Wouldn't you have to cast to that component every time you want to access it?

lennysmileyface
Автор

How do you access the transform component from other components

DanielJamesCollier
Автор

I'd suggest reading minecraft's source code. there are many places you can find that at, and it can seriously help you as it pretty much has the exact same structure you upgraded to.

zabola
Автор

i LOVE it! btw. i'm developping a game using libgdx framework (java) and i'm quite deep... but the deeper i go the more problems appear. so I'm tempted to rewrite some code to Ashley (which is ECS for libgdx). however i'm afraid of this change. it looks like a loooot of work and I don't want to break everything... but i think there is no other way

greguar
welcome to shbcf.ru