Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (593)
Games in Android Showcase (168)
games submitted by our members
Games in WIP (646)
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  Games Center / WIP games, tools & toy projects / Re: Dungeon crawler game (untitled atm) on: 2015-04-23 10:42:12
Nice! Do you have a homepage or something (twitter etc)?

What about combat - is the game in realtime - Eye of the Beholder style - or turnbased like the old Might and Magic titles? I prefer the latter, but not too many of those around nowadays.
2  Discussions / General Discussions / Re: Where can I find fast spatial querying? on: 2015-04-16 09:24:08
If you go with a grid for spatial partitioning (which sounds like a good fit for a TD game), consider to register each entity in all cells they occupy. I used to only put the anchor point in the cell, which required checking neighboring cells for collisions too.

My approach is usually to have a 1d array of Bitsets representing the grid and entities; though it requires that your entities/colliders can be represented by a zero-based numbering scheme.

http://gameprogrammingpatterns.com/spatial-partition.html
3  Game Development / Newbie & Debugging Questions / Re: [LibGDX] Entity Components - Should I read from file? on: 2015-04-10 14:30:01
Sorry for the late reply, I saw your reply late in the night, decided I'd attend it tomorrow - and "tomorrow" was several days ago.

You probably don't want to serialize the entire entity as this would include a lot of data tied to the engine. Json might be a little  verbose, but it's very easy to work with. I have some old artemis code lying around which reads entity definitions from json; it should be rather easy to adopt, as ashley and artemis have very similar API:s. Not the most efficient code, but it works.
4  Game Development / Newbie & Debugging Questions / Re: [LibGDX] Entity Components - Should I read from file? on: 2015-03-30 13:56:48
You basically don't want to serialize components like Sprite, instead rely on having an AssetReference component or similar. I tend to divide my components into plain data and transient components. A transient component is basically a component which doesn't readilylend itself  to de/serialization. You have to construct those from plain data components, in the case of saving/loading.

Some more info here, though managers are specific to artemis, I'm sure something similar can be used for Ashley too: https://github.com/junkdog/artemis-odb/issues/128#issuecomment-52243456

As for save format, json is pretty convenient although it can be verbose unless you take steps optimize it.

Edit: example AssetReference component.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
public final class AssetReference extends Component {
    public String atlas;
    public String frame;
    public boolean animated;
    public float duration;

    public AssetReference(String atlas, String frame) {
        set(atlas, frame);
    }

    public void set(String atlas, String frame) {
        this.atlas = atlas;
        this.frame = frame;
    }
}


5  Game Development / Newbie & Debugging Questions / Re: Where to start for something like this on: 2015-03-13 17:30:36
The Procedural Content Generation Wiki is a pretty good place to start.
6  Discussions / Miscellaneous Topics / Re: Unit Testing: Waste Of Time? Discuss on: 2015-02-06 01:35:50
I think unit testing suddenly becomes important in a lot of cases when using dynamic languages, which are popular, thus leading to popularity of practices like TDD etc. Here's one such post: http://williamedwardscoder.tumblr.com/post/54327549368/dynamic-languages-are-unmaintainable-and-unit

Also for languages with explicit memory management, unit tests can be pretty powerful when wrapped in a runtime memory analysis tool: detecting uninitialized memory, dangling memory etc.

At work, we have a somewhere around 11k unit tests last time I checked; granted, most are more system/integration tests than plain unit tests. The test environment gets deployed across a range of different configurations (OS, database vendors, application containers, JVM versions etc); it's quite common/annoying that some errors are only  reproducible in very specific environments/configurations.

Heh, many years ago, I wrote a payroll + reports application for small casino (a type of casino-in-bars thing that are quite common here) - it was my second project as a solo developer and took place during the time when I thought unit testing was mostly a tool for consultants to embellish their invoices.

Turns out that when your software is essentially dealing with cash flow, it rapidly spins out of the comfort zone every time something looks quirky. After going live and finding the first couple of bugs, every damn anomaly starts looking suspect.

Once the worst of my paranoia had passed, in parts thanks to not uncovering any really serious bugs (aside from a few embarrassing mistakes), income tax laws changes and I had to incorporate it into the software. Naturally, the application still had to be able to generate reports the old way too. And so began another stretch of weeks with too much stress and anxiety.

The above anecdote is of course on the extreme end of stupidity in regards to unit testing. Don't ask me why I didn't start writing unit tests asap upon realizing the error of my approach, but I didn't,

For code out in the wild, only artemis-odb is unit tested: I started doing it when I cleaned up the bugs from vanilla artemis; once dev on new features begun, I tended to write tests for them too. I wasn't aiming for complete coverage, but I think it's mostly complete. When refactoring, having a semi-good coverage helps a lot - it was pretty much what made some refactoring work possible without messing up (like when changing the way entity groups were identified within the framework).
7  Discussions / Miscellaneous Topics / Re: The joys of game dev in C++ on: 2015-02-02 13:56:08
Ah, too bad; I've heard valgrind had some issues on OSX in the past. Well in that case, clang's analysis tools might be another option (I assume you're already compiling with either GCC or Clang?). Might be my lack of in-depth experience with c++, but just running the unit tests with valgrind has been indispensable for tracking down bugs.
8  Discussions / Miscellaneous Topics / Re: The joys of game dev in C++ on: 2015-02-02 13:30:40
This is a race condition and I have no idea where it is coming from since the code base is huge and very abstracted.

So, did you try valgrind? I've never used to detect race conditions myself, but according to the blog post Valgrind is *NOT* a leak checker, it can.

Edit: Alternatively, if you're compiling with clang, it apparently has similar features built in (address sanitizer and thread sanitizer).
9  Discussions / Miscellaneous Topics / Re: The joys of game dev in C++ on: 2015-02-02 11:00:57
valgrind is your friend.

What I use:

valgrind --track-origins=yes --tool=memcheck --leak-check=full --num-callers=40 ./executable
10  Games Center / Showcase / Re: [Android] Crazy Shooter - Shoot'em up & Pixel art on: 2015-01-23 16:31:52
That looks really impressive! You ought to provide the youtube video in this post (the one you've featured on the Play store page); gameplay video > screenshots.

Personally, I can't stand playing twitchy games on my phone or tablet. Any chance you could provide an executable jar for desktops too? I'll take it for a spin on tablet when I return home though.

Edit: sorry, missed the youtube link... damned weekdays.
11  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.
12  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.
13  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.
14  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
15  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.
16  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
17  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.
18  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.
19  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.
20  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
21  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.
22  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.
23  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.
24  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.
25  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).
26  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*.
27  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.
28  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.
29  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.
30  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.
Pages: [1] 2 3
 
deepthought (24 views)
2015-06-30 15:39:44

deepthought (26 views)
2015-06-30 15:39:09

deepthought (34 views)
2015-06-30 15:36:52

Za\'Anzabar (21 views)
2015-06-29 05:44:54

TritonDreyja (36 views)
2015-06-24 17:10:40

CopyableCougar4 (33 views)
2015-06-23 00:34:45

BurntPizza (38 views)
2015-06-21 20:36:46

cookiecompiler (80 views)
2015-06-11 15:42:53

cookiecompiler (44 views)
2015-06-11 15:41:14

NegativeZero (72 views)
2015-06-11 09:49:18
How Do I Expand My Game?
by bashfrog
2015-06-14 11:34:43

List of Learning Resources
by PocketCrafter7
2015-05-31 05:37:30

Intersection Methods
by Roquen
2015-05-29 08:19:33

List of Learning Resources
by SilverTiger
2015-05-05 10:20:32

How to: JGO Wiki
by Mac70
2015-02-17 20:56:16

2D Dynamic Lighting
by ThePixelPony
2015-01-01 20:25:42

How do I start Java Game Development?
by gouessej
2014-12-27 19:41:21

Resources for WIP games
by kpars
2014-12-18 10:26:14
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!