Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (539)
Games in Android Showcase (132)
games submitted by our members
Games in WIP (603)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1] 2 3
1  Discussions / Miscellaneous Topics / Re: What is with version 3? on: 2014-12-17 12:33:29
Any what 'version 3'? Why not 'version 2' or 'version 4'?

Generally, I expect there to be some API incompatibilities when bumping a major version, though 3 certainly doesn't have any special significance. When applicable, I prefer semantic versioning - in short it states that any code used against an earlier major version will continue to work the same way. However, unless explicitly stated by the framework/lib/language, one cannot assume that an x.y.z version adheres to semantic versioning.
2  Discussions / Miscellaneous Topics / Re: The C family, should I dig deeper? on: 2014-11-28 11:50:15
I highly recommend the book The C Programming Language 2nd Edition by Brian Kernighan and Dennis Ritchie

Seconded.

The closest you'd get in C++ would be A Tour of C++ by Bjarne Stroustrup ("most notable for the creation and development of the widely used C++ programming language." - wikipedia). It doesn't cover everything, but it serves as a very good introduction to C++11.
3  Discussions / Miscellaneous Topics / Re: C#, did Microsoft just want to be different? on: 2014-11-26 16:38:10
HashMap<SomeUglyType, AnotherUglyLongType> map = new HashMap<SomeUglyType, AnotherUglyLongType>();

Ofc, in java 7 and onwards you can shorten it somewhat:

1  
HashMap<SomeUglyType, AnotherUglyLongType> map = new HashMap<>();


Project Lombok has val, which essentially works like C#'s var.
4  Discussions / Miscellaneous Topics / Re: The C family, should I dig deeper? on: 2014-11-13 17:16:26
I presume that if I learn C, or at least try to learn C then taking a step into low level C++ coding will be easier?

Maybe from a memory managment POV, but even then, later C++ versions (C++11) offer a lot of concepts and idioms that handle these things quite differently. If your end goal is C++ - start with it. Maybe a little advanced for an intro, but nevertheless a good primer on the C++ style of thinking: http://channel9.msdn.com/Events/GoingNative/GoingNative-2012/Keynote-Bjarne-Stroustrup-Cpp11-Style
5  Discussions / Miscellaneous Topics / Re: The C family, should I dig deeper? on: 2014-11-13 16:37:50
I don't have much experience with C#, but I got the impression that C# can more easily dig closer to the metal. C# has pointers (enabled via the unsafe keyword) and some notion of structs. There's probably more stuff as well, but nothing I recall atm.

Other goodies in C# not found in java:
- reified generics
- implicit types for locally scoped variables (var i = "hello, I'm a string")
- operator overloading

Completely agree about pascal casing though, even if it's something one gets used to.
6  Game Development / Newbie & Debugging Questions / Re: Java Game to native HTML5 & JavaScript? on: 2014-11-12 23:20:19
Like Kevin said, libgdx can compile to javascript too - no applets involved. My artemis fork provides links to a few open source games which compile to both desktop and html: https://github.com/junkdog/artemis-odb#open-source-games
7  Discussions / General Discussions / Re: How do you guys make art? on: 2014-10-22 12:40:10
I've tried making art the "conventional" way, but don't have the motivation or time to make something decent looking. In my current project, I rely exclusively on procedural generation - one can get pretty far  using only sine waves and splines. Not all types of games lend themselves easily to procedural graphics though.

I've also had some success using L-System.
8  Game Development / Performance Tuning / Re: Best way to go about many objects checking array for data? on: 2014-09-17 13:47:05
If your simulation doesn't need to be very exact and you have lots of objects, you might be able to get away with grid partitioning and calculating the gravitational forces acting on each cell (excluding the most adjacent cells); so when you calculate the pull for each object, you apply the cached pull and only check the most immediate cells. You can also split the gravity calculations over 2 frames to shave off some extra cycles.

I did this in a pet/play project and it worked quite well.

edit: Damocles beat me to it.
9  Discussions / Miscellaneous Topics / Re: What other programming languages do you use & why? on: 2014-09-16 04:52:54
(ps: is it weird that my first language was C++ but then I found Java and totally abandoned C++?)

Java is certainly a faster language to develop in while offering pretty good performance, but I was pleasantly surprised by how expressive C++11 is compared to java - barring wiring with java's reflection capabilities, the C++11 code tended to be both clearer and shorter. With CLion IDE approaching the beta stage, I'm pretty excited about diving back into C++ again.
10  Discussions / General Discussions / Re: Component Systems: Artemis style systems vs. traditional fat entities on: 2014-07-31 09:16:46
https://github.com/junkdog/entity-system-benchmarks - Nothing complete, but it's a start.

Thanks for doing this... I'll take a look and maybe one day have some time to do some comparisons with my efforts.

At work, so just a short notice: ashley 1.0.1 doesn't compare favorably to artemis forks - it spends a lot of time sorting, but I'm assuming performance artemis vs ashley will converge with later releases. Briefly discussed on their issue tracker: https://github.com/libgdx/ashley/issues/36
11  Discussions / General Discussions / Re: Component Systems: Artemis style systems vs. traditional fat entities on: 2014-07-27 17:34:27

I suppose that brings up an interesting distinction in classifying ES. None of this is rock solid terminology, so I'm curious if folks have any input. I'll classify Artemis / Ashley as type I ES. Type I basically lending themselves to having distinct structure such as having specific classes like "EntityManager", "Entity", "EntitySystem" where processing of entities occurs sequentially in a fully composed state. A type I ES often has hard coded classification schemes baked into the API that can't be altered. This is the aspect / family classification in Artemis / Ashley. In this case the CA elements that may be marginally present are hampered by a hard coded relationship to the classification scheme.


What exactly do you mean by processing of entities in a "fully composed state"? In both artemis and ashley, entities are only a little more than glorified integers (entityId - and some additional metadata, not necessarily stored by the entity itself).  Or is the hint in your definition of "Type II Es", being "fully generic" and having "self-modifying capabilities" (components as more than data-holders, I guess) - not entirely sure what either implies.

Mhhh okay...Still not too convinced here I guess. Let's wait for that performance benchmark  Grin Grin
(Not that it matters too much because Artemis is already pretty fast? So if you want to use an ES you already have a pretty good option there imo)

https://github.com/junkdog/entity-system-benchmarks - Nothing complete, but it's a start.
12  Discussions / General Discussions / Re: Java Swing GUI Creator on: 2014-07-16 13:09:28
Have to agree with Kevin.

If you want to go the route of GUI builders, make sure that the GUI format is not source code. Android has a pretty decent xml format for  everything GUI, but last time I checked I didn't find anything similar for pure swing or SWT.

My personal recommendation is to skip GUI builders and instead download MIG layout: it gives a lot of power without being obtuse.
13  Game Development / Newbie & Debugging Questions / Re: Should I move to LibGDX? on: 2014-07-08 08:12:28
Having y=0 at the bottom of the screen is actually really useful. Most objects are located by where their feet are, rather than where their head is, which makes positioning objects into an incredibly fulfilling experience.

Also, it feels more natural when objects are moving along the y-axis, especially in platformers: a falling object shouldn't have its y value increased, in my head.
14  Discussions / General Discussions / Re: Component Systems: Artemis style systems vs. traditional fat entities on: 2014-06-26 08:32:32
If feels like the prickly and gooey people have a hard time persuading the other kind why their point-of-view is the right and just way. Now I feel like waging a war on tabs vs spaces... which is counter to Watt's point, but I feel so very gooey right now.
15  Discussions / General Discussions / Re: Component Systems: Artemis style systems vs. traditional fat entities on: 2014-06-25 10:12:08
I'm actually not attempting to enter into the debate of component based or not.  You ask a question:  Do I do "A" or "B"?  I'm saying that's the wrong question.  The correct question is: "Here are my requirements (ATM)"  What options do I have?  By arbitrarily settling on "A" or "B" you're placing the importance of code before your requirements.

I read the question as - even if a bit vague - this is my higher level design, and what are some common, general approaches to these set of problems. It's no different than asking about approaches for avoiding heavy inheritance or other issues that are common to a specific domain.

@princec One layer of inheritance takes a lot more of skill/experience and forethought to pull off - code quality tends to degrade over time (I'm working in an 18 y.o. product - I stare into its perplexing depths every day); ECS's flat hierarchy tends to be more resistant to that. As Orangy Tang said, it also makes it more feasible having several programmers working on the  same code without getting in each others way.

Personally, I find ECS to be very intuitive - it lets me focus on the problems and scales very gracefully from a complexity POV (which was [the/a] primary reason for their being, not cache-friendliness - as is often brought up nowadays).
16  Discussions / General Discussions / Re: Component Systems: Artemis style systems vs. traditional fat entities on: 2014-06-24 11:41:33
I have this fantastic HDR, physically based, screen space shading code!  It runs at 200FPS!!!  So you can just drop it in any old game and not worry about performance!!!  Except that ain't so.  It ignores the math...even assuming the "user" has the same (or better) GPU.


Of course, but I don't think anyone claimed anything to that extent in this thread? The original touched CPU processing speed in regards to component/system design; certainly it doesn't make any guarantees about how often the screen redraws.

When developing for mobiles, I'm assuming everyone has (alternatively wants) a few lower-end devices to test on.

Edit: Ok, I kinda did *hrm*.
17  Discussions / General Discussions / Re: Component Systems: Artemis style systems vs. traditional fat entities on: 2014-06-24 11:22:44
FPS isn't a benchmark, rather an overall performance target. On mobiles, I think one can easily get away with 30FPS, as long as it doesn't dip below it.

Also, does the figure include actual rendering or is that just logic or is it logic and preparation to render?
Cas Smiley

Logic + preparation, I didn't/haven't investigated how to reliably get the FPS on android.
18  Discussions / General Discussions / Re: Component Systems: Artemis style systems vs. traditional fat entities on: 2014-06-24 10:53:33
500 entities isn't that much. I've managed just below 60 FPS on an old Desire Z (android 2.3, single core 800 MHz Scorpion) with 500 +/- 100 entities and ~25 entity systems.

- Don't use getters/setters for components. The JIT will inline them, but it will take time before everything is inlined
- Override processEntities and optimize which entities get processed; either by splitting the processing over two ticks or by some clever filtering (this implies that you manage the entities yourself in an optimized list, override inserted/removed in EntitySystem or roll your own)
- Direct array access is faster than getting each entity individually (processEntities): artemis-odb does this by default.
19  Discussions / General Discussions / Re: Component Systems: Artemis style systems vs. traditional fat entities on: 2014-06-23 22:48:28
I try to keep both my entity systems and components as specialized as possible: naturally, different games warrant different solutions, but I haven't found the need for optimizing in regards to marker components in a long time.

Marker components aren't *that* expensive, normally. Where and why is your CPU time consumed - because of a high entity count, sporadic insert/remove bursts, something else? It's hard to reason about an approach without seeing some example code or knowing more about your design - the risk is that you end up getting vague recommendations that don't really apply to your project.

A recent discussion over at reddit gave some ideas on how to more efficiently deal with batch insertion/removal of entities. It will find its way into 0.7.0 (sometime during the summer) - it might cover your use-case, or at least be slightly easier on the CPU.
20  Discussions / General Discussions / Re: Component Systems: Artemis style systems vs. traditional fat entities on: 2014-06-23 21:28:55
No need to poll, better sacrifice some memory and have each system maintain a list of all entities with a matching component composition. Entity Systems are notified whenever an entity has components added or removed, keeping the list up-to-date. This is how artemis and most ECS frameworks do it.

Edit: Sorry, misread your post. If dealing with a lot of entities... simply setting a flag here and there as a marker for being processed by another system, I could see why it might be a problem (are you sure it is the bottleneck though?). One solution might be a custom EntitySystem to which you manually insert entities that need to be processed as a result of some state. Alternatively, make the components even thinner, effectively having marker components and more specialized systems.
21  Discussions / General Discussions / Re: Component Systems: Artemis style systems vs. traditional fat entities on: 2014-06-23 21:14:45
I don't really have much experience coding games that don't use an ECS; maybe I've just been exposed to poor design, but imo an ECS does help structure the design and - thanks to the emphasis on compartmentalizing game logic in distinct entity systems - isn't as sensitive to spaghettification/ridiculous coupling.

Benefits of using an ECS - or stuff one pretty much gets for free:
- Since components are pure data, serialization comes almost at no cost (code-wise).
- Entity systems can easily be reused outside the game, very handy for level/game editors.
- New types can be defined on the fly - another boon for editors. Furthermore, it's pretty straightforward writing a generic reflexive editor for manipulating component data.
- Behavior reuse > code reuse.
- Easy to profile, both via profiler and in-game.
- Entity Systems can be toggled at runtime; pretty useful for debug renderers, disabling collision handling etc.

Lastly, to respond to the OP and fat components; it's certainly doable, but it tends to make the code a little more rigid and hence harder to refactor.

It's true that one of the potential benefits of ECS is writing cache-friendly code, but aside from us being in java-land now, it's not quite as simple as strapping on an ECS and automatically reaping the benefits of a happy cpu/cache relationship - Adam Martin wrote an interesting post on it recently: http://t-machine.org/index.php/2014/03/08/data-structures-for-entity-systems-contiguous-memory/

Most of the early work with ECS appears to have more to do with fast iteration times, rather than fast execution.
- http://cowboyprogramming.com/2007/01/05/evolve-your-heirachy/
- http://t-machine.org/index.php/2007/09/03/entity-systems-are-the-future-of-mmog-development-part-1/

22  Java Game APIs & Engines / Engines, Libraries and Tools / Re: JRebel on: 2014-06-18 13:53:26
And whats the difference from Eclipse?

You're not limited to only modifying method bodies, if that's what you mean. It's also possible to jack in custom resource parsers (loading level data from json or whatever). Only used it for web development myself; very handy.
23  Discussions / Miscellaneous Topics / Re: Longest program you have written? on: 2014-06-16 20:22:30
That would make for a fun java game jam/contest. Instead of "under 4k", "in 48 hours", etc, we could have a "best game with less than 500 lines of code" contest. It would have to include external settings/config files so no one cheats and stuffs all the meat into a .properties file or something.

Could be a fun idea down the road.

This would work only if everyone used (or someone who verifies used) the same [eclipse] formatter settings. It could be done though.

A more interesting approach would be to only measure the opcode count: this way it wouldn't encourage excessively obfuscated code or discourage meaningful naming conventions.
24  Discussions / Miscellaneous Topics / Re: Longest program you have written? on: 2014-06-16 19:35:39
Let's see some smaller numbers. Cheesy

I recently stumbled upon this self-playing flappy bird clone in 155 lines, incl graphics: http://glsl.heroku.com/e#14407.0
25  Discussions / Miscellaneous Topics / Re: Longest program you have written? on: 2014-06-16 17:03:46
Not sure, somewhere in the 50k-100k range. The code tends to be more expressive the longer you've programmed though, meaning the LOC to feature ratio decreases significantly. I remember back when I was somewhat fresh at programming - I could easily spew out 2-3k LOC per day; I rarely write more than 500-700 on a good day now, yet I manage to implement a lot more functionality in that same timeframe nowadays.

In the end, LOC isn't really a useful metric of anything - even if some backward companies encourage such nonsense.
26  Discussions / Miscellaneous Topics / Re: [Girls] How to completely block them from our lives? on: 2014-06-09 16:25:55
Are there not any girl programmers on this forum? I would think that there would be at least one.

This thread certainly isn't helping...

Not everyone is a programmer.

There are VERY few female programmers.

The majority of programmers don't work on games.

Thus, a female on this EXACT forum is pretty much a statistical impossibility.

Actually, the majority of the female programmers I've met have worked in gamedev.
27  Game Development / Newbie & Debugging Questions / Re: Entity Framework on: 2014-06-08 22:59:24
I was also thinking of maybe having a "root" entity that all of the entities can attach to. Then, you can specify rotation, scaling, and translation for the root. Without having to deal with pesky screen shake caused problems.

But basically what I'm asking is that if you were to make a entity framework with a nice working and learning curve, how would you do it?

Entity system frameworks typically don't have different kinds of entity types, only different component compositions making up the entities. The seminal series of articles on entity systems is still Adam Martin's Entity Systems are the future of MMOG development.


Vanilla artemis shouldn't be used anymore - it hasn't been in development for a long time and has plenty of bugs. Use one of the many forks floating around, if you like artemis' API - such as mine or gdx-artemis.

28  Game Development / Newbie & Debugging Questions / Re: [LibGDX & Artemis] Random Null Pointer Exception in System on: 2014-06-06 18:17:41
As a quick check; if you make the SpriteRenderSystem the first system to be processed (ie; add it to the world instance before any other systems), does it still throw a NullPointerException?
29  Discussions / Miscellaneous Topics / Re: Quad core + 2gb of ram on: 2014-05-30 13:53:00
If you're buying a new computer today, I wouldn't consider getting anything less than 8gb. I had 4gb in my old quad-core and I was hitting the memory barrier every day - even a browser can easily hover around 1gb mem usage when enough tabs are open; then consider IDE, background processes, the OS, gimp/photoshop etc. Ideally, you never want to close applications due to running low on RAM.

30  Game Development / Newbie & Debugging Questions / Re: Does anyone create custom annotations in their game code? on: 2014-05-21 15:14:37
And let's not forget project lombok for some clever hacks involving annotations and the JVM.
Pages: [1] 2 3
 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

rwatson462 (33 views)
2014-12-15 09:26:44

Mr.CodeIt (23 views)
2014-12-14 19:50:38

BurntPizza (51 views)
2014-12-09 22:41:13

BurntPizza (84 views)
2014-12-08 04:46:31

JscottyBieshaar (45 views)
2014-12-05 12:39:02

SHC (59 views)
2014-12-03 16:27:13

CopyableCougar4 (60 views)
2014-11-29 21:32:03

toopeicgaming1999 (123 views)
2014-11-26 15:22:04

toopeicgaming1999 (114 views)
2014-11-26 15:20:36

toopeicgaming1999 (32 views)
2014-11-26 15:20:08
Resources for WIP games
by kpars
2014-12-18 10:26:14

Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50
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!