Java-Gaming.org Hi !
Featured games (81)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (119)
games submitted by our members
Games in WIP (576)
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 ... 8
1  Games Center / WIP games, tools & toy projects / Re: TyphonRT Video Suite (Kickstarter) on: 2014-10-14 06:37:39
The promo video is like a tech demo. Where's the motivating narration, something to lure in the potential funder and pitch your product. Imagine the first iPhone to be marketed without Steve screaming 'amazing!', 'fascinating!', 'best phone!', 'revolutionary!', 'unparalleled!', 'beautiful!', 'masterpiece!', at the willing audience.

Good point.. I made this the first update and didn't put it at the end of the sizzle video. I'll probably add it to the end of the sizzle reel... Here is the video:
https://www.kickstarter.com/projects/85808410/typhonrt-video-suite-next-gen-video-apps-for-andro/posts/1016236

In the snippet with the local news reporter, the visual effect is not clear... and it's anti-Putin, which can be a turn off for people. Keep your video politically neutral Smiley

Wait someone likes Putin? ;P OK US / west coast bias here. I did think about this, but time ran out before being able to reshoot. I'll see if I can swap out that section. The creative team I was working with didn't advise on putting the text caption before the news reporter: "Edit lower thirds in the field" like I suggested. They said that was too technical of a term. I dunno.. The clip is supposed to show that you can do lower thirds in the app and not have to go back to desktop editing to get a reasonable news clip for posting online.

Thanks for your feedback for sure!
2  Games Center / WIP games, tools & toy projects / Re: TyphonRT Video Suite (Kickstarter) on: 2014-10-14 06:21:56
If your highest tier is $50, you're going to have a hard time. Where is the "$25,000 to have dinner with the dev and access to a private forum" tier? Tongue But seriously, there may be people/enthusiasts/diehards willing to spend more than you're asking for. Even if nobody is going to end up paying >$50, having higher tiers means you've got the guts to ask more - which might convince people funding just a tad more.

Good eye.. I'm adding these expanded reward tiers tomorrow morning before I blast the rest of the world. I actually had them all edited, but messed up with saving them and they all disappeared..  Cry I've got to get the demo code for the presentation this weekend working tonight. :: sigh :: 16+ hour day here if not longer!   Some of the higher reward offerings will include dinner at the studio (I'm actually a good cook too) and one night and weekend long immersive gaming sessions at the studio. I'm also going to offer a 10k reward (max value possible) to custom code a photo app using the effects preset editor with the HTC M8 depth camera. I've already got all the depth mask effects code written in general. Sadly the HTC M8 only works with photos, but they'll have exclusive access to that app for at least 6 months and can brag to all their friends.   Roll Eyes  There is a launch party as well starting at the $100 tier for tickets.

With any luck this weekend at the Big Android BBQ I'll be getting an in person demo in front of several decent Android blog folks and any posts like that will definitely help get eyes on the site.

Also have www.typhonvideo.com up... First time getting things up on a CDN and getting video backgrounds working.

3  Discussions / General Discussions / Big Android BBQ (Texas) & AnDevCon (SF) conferences on: 2014-10-14 04:31:25
Hey folks...  Anyone going to the following conferences?

Big Android BBQ - http://www.bigandroidbbq.com/  (This week!)

or

AnDevCon - http://www.andevcon.com/ (November)

I'll be at both and am presenting on modern graphics / video engine development with OpenGL. The topics are of course Android related and I'll be covering a lot of broad material starting from OpenGL ES 3.0 support which is the foundation of modern engine development to OpenGL full profile on mobile. Given time for a deeper dive I'll be highlighting compute shaders which is OpenGL ES 3.1 functionality that is imminently available on Android.

The Big Android BBQ presentations might be streamed / recorded. I'm speaking there if the schedule doesn't change Saturday at 12:30.  I present Friday late morning at AnDevCon in November.

You better believe I'll be beating the street promoting my recently posted Kickstarter at these two events:https://www.kickstarter.com/projects/85808410/typhonrt-video-suite-next-gen-video-apps-for-andro

I made 5k business card sized promo flyers and will harken back to my underground electronic music event promoter past with a bit of hustle.
4  Games Center / WIP games, tools & toy projects / TyphonRT Video Suite (Kickstarter) on: 2014-10-14 03:51:22
I've finally launched the Kickstarter for the next-gen suite of video apps I'm launching for Android. The marquee launch app is a creative video capture app that combines an open ended effects composition preset editor. I spent a good deal of effort and time refining the info & promo video. Be sure to check out the Kickstarter here for expanded info:

https://www.kickstarter.com/projects/85808410/typhonrt-video-suite-next-gen-video-apps-for-andro

Check out the Kickstarter page for the promo video! Let me know what you guys think. Cheesy

Some promo shots:

5  Discussions / Miscellaneous Topics / Re: Something like libgdx for business logic on: 2014-10-10 08:17:32
Just use RoboVM directly. They had a session at this years JavaOne and mention a test app for Android / iOS that is in their Github samples repo.
http://blog.robovm.org/2014/10/robovm-at-javaone-2014.html
6  Discussions / Miscellaneous Topics / Re: Is drinking half a bottle of vodka safe? on: 2014-10-10 03:18:41
A wise and literary oriented roommate of mine in college wrote on my whiteboard many funny quotes about Java back in '98... The top right most though applies to vodka...

"Vodka is like a debugging tool for the soul; it takes it apart line by line and shows you what to fix."

-- Luke Peacock


7  Discussions / General Discussions / Re: Worried on: 2014-10-09 16:43:59
Learning multiple languages is handy because it reveals the patterns that are common to programming. For instance one of the basic things you do in most languages is read data in from a file / file system. Once you have a catalog of the ~10 most common things you need to do to accomplish X picking up a new language and getting to X is usually a matter of a few checks in a book or online reference and off you go. Syntax may change, but essential programming concepts are shared across a large cross-section of the implementation details in any given language of a given class (imperative, functional, etc. etc.)
8  Discussions / General Discussions / Re: Learned more than intended.. on: 2014-10-09 02:09:26
I really lucked out as my freshman year in '96 the best CS professor at the uni (Clint Staley!) offered a new course that combined the typical 101, 102, 103 (first 3 freshman classes) into an intensive one quarter onslaught of C++. You didn't need to take the final if you created a chess program that could beat the professor. The last actual assignment was a fairly difficult bin packing problem. My 2nd quarter I took computer architecture I and the 3rd quarter as a freshman I was in computer architecture II with practically all seniors several of whom failed that course and needed to pass to graduate.. I got a C my first go, but moved on..  Emo  I then finished and then some my _senior project_ the summer of my freshman year..  Roll Eyes I actually finished most of my major courses in the first 2 years and almost got bored having to finish all the GE.

As others have mentioned the rabbit hole goes quite deep, so just find something you are interested in and start / continue the endless self-education process. For me that was audio and I immersed myself in the general computer music discipline along with graphics. The computer music stuff however was no where to be found at my uni, so all self-taught. It never ends and I've been at it for 20+ years now and learn new things all the time!
9  Game Development / Newbie & Debugging Questions / Re: 4 or more threads in render loop on: 2014-10-07 05:16:04
So when did you stop supporting Java 1.4?  Roll Eyes  OK.. Been a while since I've read anything about your backward compatibility decisions. I think if you said I'm using ForkJoinPool and invoke that would have gotten around a lot of the chat above. Yeah. Hard to say how much faster one can get with that particular direction w/ the invoke and wait strategy. The only thing I can think of offhand is not storing things in a Sprite class, so a bare array of data to render to be more cache friendly (of course there are limitations in this direction / less readable code, etc.). I was under the impression that you were filling buffers concurrently to a separate rendering thread. Figuring out a strategy like that will make things faster as you fill separately and render immediately with latest filled data. Even a separate single thread filling buffers could be rather quick. I'm not saying implementing this is easy; it sounds like you are plenty happy with performance presently, so you know... keep making that game. Can't wait to see it.

I'm quite glad Doug Lea and all put out most of the java.util.concurrent code as public domain:
http://g.oswego.edu/dl/concurrency-interest/

Been stuck in Java 6 land w/ Android, but thinking about integrating the JSR-166 code eventually into TyphonRT.
10  Discussions / Miscellaneous Topics / Re: What I did today on: 2014-10-07 04:32:51
Worked with a professional photographer yesterday to capture multiple shots at the Golden Gate bridge for a product shot and just finished editing it. Really lucked out on good weather. The fog started rolling in not long after this shot as we made our way up to Twin Peaks for more promo video shots. It's a composite shot with a screen capture. I also happened to get lucky that the screen capture size practically matched the depth / size of the phone image. This shot is clipped / scaled, but still reasonable quality for the screen. Full one looks great.

For a full size (just slightly scaled version to make Imgur):
http://i.imgur.com/E3vMx9e.jpg

11  Game Development / Newbie & Debugging Questions / Re: 4 or more threads in render loop on: 2014-10-04 22:48:27
I use a circular buffer of VBOs and just pick the next one each frame.
Using a circular buffer of several VBOs means I don't seem to fall foul of synchronisation issues.

This sounds similar to the generally naive approach I take with the render / encoder threads in my video engine for the OpenGL ES 2.0 implementation except replace VBO w/ FBO; just use a blocking queue that the encoder thread waits upon. It works in practice on every device I've tested, but could potentially be unsafe. I'll be beefing things up a bit w/ OpenGL ES 3.0 threading API quite likely soon.

There's no other synching going on anywhere else - it's all just parallel workloads made by chopping stuff up into equal size chunks, one for each core.

What you describe sounds fine for one worker thread filling buffers and one render thread. Likely the worker thread will always have the next buffer full before the render thread renders it. I'm trying to figure out the multiple producer / single consumer scenario you mention without synch. Say 100k sprites and each worker thread (say 5) are dealing w/ 20k sprites each filling a single buffer (sync issues). Or is it 5 worker threads each filling their own buffer of all 100k sprites into a unique VBO in the circular buffer of VBOs (starvation in rendering or skipping to the most recent buffer filled when render occurs / IE wasting CPU on worker threads).

Obviously it's working and you see an improvement. Just curious and all.. 

 
12  Discussions / Miscellaneous Topics / Re: What I did today on: 2014-10-04 19:58:21
So I recorded this teaser video a couple of weeks ago with my video engine / capture app that I'm doing the Kickstarter for starting next week.. It's a sneak peak I suppose of what it can do and I'd be glad to hear some input from folks here. The video capture / effects composition app is running on the Nexus 5 and all effects are burned in while recording presently (next version will allow effects on playback). The Nexus 5 / Adreno 330 was the first mobile GPU that allowed a really deep post processing pipeline (previous FBO restrictions reduced significantly). What you don't see in the video is the GUI to control all of the effects pipeline in real time while recording. IE the color changes and other tweaks in the video.

One of the fun things about San Francisco are the street fairs and once a year when I open my door there are lots of people outside. The Folsom Street Fair is... I'll go with interesting and I suppose quirky. I made my way to the main stage and caught Monarchy's set which was pretty good. Here it is...

<a href="http://www.youtube.com/v/23U6NYgQniM?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/23U6NYgQniM?version=3&amp;hl=en_US&amp;start=</a>
13  Game Development / Game Mechanics / Re: Downstream and upstream on: 2014-10-04 19:52:20
Perhaps take a look at the Android UI implementation for an idea. Specifically ViewGroup implementation which is the base class for layout components, IE ones that hold other UI components. The relevant method is "dispatchTouchEvent"

http://developer.android.com/reference/android/view/ViewGroup.html#dispatchTouchEvent(android.view.MotionEvent)

Events in the Android UI are passed from base parent to leaves and the entry point is dispatchTouchEvent. The cool thing is that you can do all sorts of interesting overriding of that method to provide custom event delivery.

Conceivably in you implementation you'd start at the root UI component with something like dispatchTouchEvent and if that root component was not visible you quit the dispatch. If the bounding box of the base UI component does not contain the event coordinates you quit, etc.
14  Game Development / Newbie & Debugging Questions / Re: 4 or more threads in render loop on: 2014-10-04 19:27:46
I wouldn't know a disruptor if it came up and bit me on the arse, but I think what I'm doing here for performance is basically "rendering" (less the particle logic and such).

Yes, yes, yes; a little less misdirection...  Kiss Rendering is the main discussion... re:

"In my case the sprite engine I use animates, sorts, transforms, and writes out all the sprite vertex data using a thread-per-core and achieves a very tidy speedup as a result (when we're talking tens of thousands of sprites)."

I posited a direction of least resistance in regard to how one can handle synchronizing a multithreaded CPU side buffer filling mechanism as you outlined. For others and heck even myself are you interested in commenting on the synch mechanisms you use. IE 2 buffers swapping an AtomicReference when ready and the render loop / thread just chugs along picking up the buffers from the current ones stored in the AtomicReference oblivious of any multi-threading going on to fill those buffers. The question was generally how you are solving the synch issues with the worker threads and render thread since it's not a fork / join type task. This will help others think about the problem and come up with a solution.

While I don't have an optimized sprite engine I do have a general computing (grid counting demo) that is implemented in OpenCL and various CPU implementations from serial to multi-threaded using a similar mechanism as I described above. The multithreaded CPU version gives about 6x improvement in speed over the single threaded solution when mapped to approximately the same number of threads as cores on the CPU. Is that about what you are seeing?  It's nice because I can use a software OpenCL implementation to test if my Java multithreaded implementation is efficient and it's pretty close.

I'm speaking kinda generally here.  You might need something like disruptor if your doing an MMO.

So was I here on general patterns. The Disruptor pattern works well for high throughput discrete event passing. The way LMAX uses it for even higher performance is the slots in the ring buffer are actually byte arrays instead of objects. The reason I'm keen to the Disruptor architecture (let's be honest here; it's a fancy ring buffer; are we scared about talking about ring buffers here because there is a name attached to a particular use case / implementation?) is that what I'm doing is highly event driven via the EventBus pattern (though different implementation to Otto or Guava's) meaning that it is a good fit for my architecture in general for data coming in and off the wire. Stop me now before I talk about the "DisruptorBus"  Roll Eyes I'd have dug into this area a lot more already if it ran on Android and didn't depend on sun.misc.Unsafe aspects which aren't supported on Android. Like all things this is infrastructure for a particular use case / problems at hand (certainly leaning toward MMO scale as Roquen mentioned) and as an engine developer potentially allows me to provide APIs to general developers, you know game developers, who won't have to think about the complexities of threading under the hood.

My uses of CPU side multithreading presently are much more close to the complete buffer filling and swap scenario as originally discussed.
15  Game Development / Newbie & Debugging Questions / Re: 4 or more threads in render loop on: 2014-10-03 23:10:04
In my case the sprite engine I use animates, sorts, transforms, and writes out all the sprite vertex data using a thread-per-core and achieves a very tidy speedup as a result.

Chatting a bit about data synchronization may give some bread crumbs to the folks interested in multithreading CPU side.

To achieve synchronization do you use double the memory and have active render buffers and buffers to fill and swap them when ready with an AtomicReference, etc?

I've found in general synchronization use cases for game / video engine dev that the CAS (compare and swap) operations are sufficient for synchronization CPU side without having to go full bore ala ring buffer or the direction the Disruptor takes for really high performance throughput. Because one is dealing with full buffers of data and not many discrete individual events / data updates CAS operations are plenty quick to handle synch for typical game engine use cases.

The Disruptor architecture though is pretty bad ass because it allows creation of a producer -> multiple consumer dependency graph; IE really useful for network marshaling and journaling that has many discrete events / data leading to one business logic / game logic thread, then back out via another Disruptor chain. And that is a basic example.
16  Game Development / Newbie & Debugging Questions / Re: 4 or more threads in render loop on: 2014-10-03 20:29:32
I'd be curious if Cas would like to share more info on what aspects of his engine efforts were split between threads.

Typically, an update / render loop should be one thread. Where multiple threads really come into play is any marshalling of data between network and depending on the use case journalling (could be useful for debug / replay of game sequences / especially network data). I'd say look at the Disruptor architecture for a solution and technical info in this regard:
http://lmax-exchange.github.io/disruptor/

For game engine use cases I can see streaming data to the GPU / say new texture or geometry data for large levels being facilitated via threads on the CPU and use of the GL threading API.

In my OpenGL ES video engine for Android I handle encoding and rendering to the screen in separate threads that share two GL contexts for texture / FBO data. This allows 30FPS+ of rendering to the screen and the encoding at the same time where if these operations occurred sequentially in the same CPU thread then performance for both drops to ~15FPS.

As a baseline you'll want to examine the threading API of OpenGL ES 3.0 for the essentials of coordinating GL operations. ARM has a good tutorial:
http://malideveloper.arm.com/downloads/deved/tutorial/SDK/android/1.6/thread_sync.html

In general though as has been mentioned already; unless you have a specific use case the answer is usually no; single thread for update / render.
17  Discussions / Miscellaneous Topics / Re: What I did today on: 2014-10-03 00:24:07
Meh... All day today I was getting Amazon Payments still just partially setup for an imminent Kickstarter launch of the TyphonRT video suite of apps for Android. Got to say that I've really enjoyed working with Square 1 bank though as they have been really helpful. Got the studio room completely cleaned up last night just in time for a video crew to pop by though more filming this weekend and more paper work tomorrow (t-minus 7 days to launch; we'll see). Hah, got a UPS mailbox (street address) today, so we'll see if that satisfies the Google Play change for showing all developer addresses. Anyway.. Here is a pict from the humble beginnings in what was originally a wagon repair shop built in the 1920's to what the studio looks like with some extra lighting from the film crew and my take on the future almost 100 years from when it was built.

18  Games Center / WIP games, tools & toy projects / Re: Gods of Sparta on: 2014-10-02 20:26:45
I'll just create all the graphics for 2560x1600 and then scale it down.

Might as well do 4k (4096x2160) or 3840x2160 for 16:9 aspect ratio with the latter more likely going to be the next top pixel count as you know OEMs can't wait to throw that 4k number around for marketing purposes battery be damned...  Shocked Sadly it's going to happen all too soon.

Good luck with the port. Might be interesting to do match negotiation via BLE then setup wi-fi direct after discovery unless you don't need to send a lot of data between devices being a turn based game. Alas there are some caveats with BLE on KitKat, but then again it's Google, so what can you expect.  Wink

The other trick prior to the hardware scaler being available was rendering into a smaller FBO than the screen size and just blit that quad to the full screen. Still useful for post processing effects.
19  Game Development / Newbie & Debugging Questions / Re: Android Studio: package com.badlogic.gdx does not exist on: 2014-10-02 13:02:26
Althoug I would like to understand how to solve these issues I guess most time efficient will probably just to create a new LibGDX project, import it into AS and copy/paste all my classes and assets from my project into the new AS project

Yes, I thought we were talking about fresh projects.  Roll Eyes That is definitely necessary for the new LibGDX build system in regard to the setup of the Gradle build, file structure, etc. I wouldn't trust AS to import Eclipse projects correctly let alone a LibGDX project.

If you have a fresh project created from the most recent LibGDX project creator GUI copy over your old code & assets as applicable. Then you may want to watch out for the small disjoint I mentioned above that can happen when you constantly update AS which may bump the Gradle versions supported or other small changes required to the parent build.gradle file.
20  Games Center / WIP games, tools & toy projects / Re: Gods of Sparta on: 2014-10-02 01:38:48
For Android consider the hardware scaler to lock to 1080p or even 720p. You'll get better performance and also don't have to worry about all sorts of variations of higher screen sizes.

http://android-developers.blogspot.com/2013/09/using-hardware-scaler-for-performance.html
21  Game Development / Newbie & Debugging Questions / Re: Android Studio: package com.badlogic.gdx does not exist on: 2014-09-30 19:14:50
You should figure out the Gradle configuration issues as LibGDX will be pulled automatically from Maven and you'll update LibGDX versions used via the Gradle build config files as well. I am assuming without more info that the problem you are facing regards a mismatch in the Gradle config files the LibGDX project creator is outputting and the latest Android Studio Gradle / build setup.

Here is how you can verify which Gradle build number you should use. First create a normal Android app in Android Studio. This will be your reference, so that you can verify the Gradle config information. You'll want to look at the top level build.gradle file under your main project directory. The very top of it should look like this:

1  
2  
3  
4  
5  
6  
7  
8  
buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.12.+'
    }
}


Take note of the classpatch dependency for gradle version number; above this is "0.12.+"

Now create a LibGDX project and open the build.gradle file in the parent directory.

It may look like this:

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  
buildscript {
    repositories {
        mavenCentral()
        mavenLocal()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.10.+'
        classpath 'com.github.jtakakura:gradle-robovm-plugin:0.0.10'
    }
}

allprojects {
    apply plugin: "eclipse"
    apply plugin: "idea"

    version = '1.0'
    ext {
        appName = 'MyGame'
        gdxVersion = '1.2.0'
        roboVMVersion = '0.0.14'
    }

    repositories {
        mavenLocal()
        mavenCentral()
        maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
        maven { url "https://oss.sonatype.org/content/repositories/releases/" }
    }
}


If the top Gradle version number is different than the normal Android app you created previously then copy the version number from the normal Android app to the GDX build.gradle file. IE change "0.10.+" to "0.12.+"

Also when you first open up an Android studio project navigate to the directory and click on the top level build.gradle file instead of the top level parent directory.

To resynch the Gradle build in Android Studio you will either be prompted automatically when you make changes to the Gradle build files or what is handy is to kick off updating the Gradle build manually. You do this by selecting from the top Android Studio menu: Tools -> Android -> Sync Project with Gradle files 

If your gradle config is correct and in line with the Android Studio versions then Gradle will automatically pull down LibGDX and all dependencies such as RoboVM.

Don't manually include LibGDX as jar files as that will just complicate things and is not the way to set up a Gradle project especially since LibGDX is configured to pull from Maven repos automatically.

When you need to update your version of LibGDX you update the "gdxVersion" and "roboVMVersion" and then hit the sync project w/ gradle files option and the latest versions will be pulled down.

Again, without having more details on what you are facing this is my assumption of what might be holding you up. Gradle take a bit of time to wrap your head around, but is well worth understanding because it is a powerful build system that both Android Studio and LibGDX uses. Let me know if this helps!
22  Game Development / Newbie & Debugging Questions / Re: Android Studio: package com.badlogic.gdx does not exist on: 2014-09-29 19:19:43
It could be handy to make sure you have the latest LibGDX version / project creation tool and just create a new project via the GUI tool and then move your source code into the new project. The project creation tool is quite a bit more stable at this point. All dependencies like LibGDX or RoboVM is downloaded automatically via the Gradle config files. Usually from a Maven repo.

Sometimes the LibGDX project creation tools are behind the latest Android Studio Gradle versions and such in the build scripts the GDX tool creates. Often it just requires a couple of changes to the main build.gradle script and then things work right away.

It's hard to help without much more info on your side.
23  Game Development / Newbie & Debugging Questions / Re: Android Studio or that sexy LibGDX? on: 2014-09-29 19:10:49
@Jacob

If you are new to Android there are a lot of things to get your head around. Definitely use Android Studio which is where all new Android tools efforts is focused from Google from here on out. The build system called Gradle drives normal Android app builds and also LibGDX builds. Gradle can be a bit of a head scratcher until you get a handle of what it can do and any of the "pain points" on getting a project setup and also updating all of the Android SDK / build tools, etc.

The LibGDX GUI project creation tool does a pretty good job, but isn't always updated in lock step with the Android build tools updates or gradle versions supported by the absolute latest Android Studio version. Often after making a LibGDX project one has to go in and modify the gradle files to get things to build if your Android SDK setup is ahead of GDX, etc. It's not too hard once you know the pain points. It should be noted though that similar pain points exist with Gradle for normal Android app development w/ Android Studio.

I'd say consider the learning curve of Android Studio, Gradle, and LibGDX project configuration to be similar problems. Once you learn any pain points it's easy to set up projects for cross-platform builds. There probably is a tutorial or two waiting to be written about this last mile setup issues. I've successfully used LibGDX / Android Studio for desktop, Android, and iOS builds. I really like being able to do easy command line builds via Gradle as well especially for iOS where one doesn't need to open Xcode.
24  Game Development / Game Play & Game Design / Re: Enemy class hierarchy on: 2014-09-25 19:40:14
General takeaway: composition using interfaces rather than deep class hierarchies.

Composition is key whether you do it explicitly (traditional OOP / what Cas is doing) or implicitly (component architecture). The latter has also been called the Entity System Architecture or Entity Component Architecture when used in a game context for entity systems.

Creating an entity system via inheritance (traditional OOP) which is the direction you have originally taken is a nightmare eventually unless your game is simple and well defined. Big problems occur when you want to copy or have the same behavior shared between unit types that don't directly descend from the same parent. The nasty hack / anti-pattern that then rears it's head is the god object as one pushes up to the base entity class more and more functionality that is potentially shared between various branches of unit types.
25  Discussions / Miscellaneous Topics / Re: I'm scared of Unity on: 2014-09-25 19:20:22
libgdx needs an editor like Unity has, many people said this
if it did it would be massive. Some tilemap integration(ever tried doing tile maps in unity? I hear its a nightmare), also Spine integration, bitmapfont tool, particle editor - stuff that all exists, put them all in there.

Have you seen Overlap2D yet? Looks neat, haven't played around with it myself.

http://overlap2d.com/
26  Discussions / Miscellaneous Topics / Re: Whays the story behind your name on: 2014-09-21 01:57:56
Catharsis was my original DJ name back in the day.... I found it kind of odd back in the day when I was active for folks to yell out, "Hey Catharsis," from across the street in public.. I kind of came out of the generation where the focus was on the music more than performer per se...

Posted a link of a bunch of historical DJ sets last month:
http://www.java-gaming.org/topics/i-once-was-a-dj-50-hours-on-soundcloud/34012/view.html 
27  Game Development / Newbie & Debugging Questions / Re: Is this possible to port from C++ to Java? on: 2014-09-20 09:14:16
Typically you'll want to use a native binding for Box2D. LibGDX provides this https://github.com/libgdx/libgdx/wiki/Box2d

The second aspect is that you need to confirm that the Box2D functionality that DestructibleBox2D uses is supported by the Box2D binding of LibGDX.

The third aspect that you need to detangle since DestructibleBox2D depends on Boost.Geometry is to figure out what aspects of that library are used and reimplement it in Java quite likely, but just what you need to accomplish the task.

Something to keep in mind is efficiency for collections. LibGDX may provide all you need, but I haven't looked at DestructibleBox2D in depth. Avoiding creating objects all the time on the Java side is pertinent.
28  Game Development / Game Play & Game Design / Re: How do I make a moddable game in Java? on: 2014-09-20 08:52:17
Perhaps take a look at OSGi; in particular Apache Felix http://felix.apache.org/. OSGi handles loading modules including handling all of the classloader aspects, but doesn't provide an in app API beyond the services registry of the OSGi framework itself which stops short more or less with what is needed in a game. This is where matching OSGi with an in app component architecture really shines and is the direction I've been moving down for quite some time as far as engine / framework architecture is concerned.

Another tidbit interesting to peruse is the MMM (Modularity Maturity Model) as a general guideline on the stages of modularity. http://www.infoq.com/news/2011/09/mmm-osgi

My work with TyphonRT is very modular and I have a loading mechanism that doesn't depend on OSGi presently. At some point I'll be looking into combining the two, but mostly to achieve hot swapping of modules which isn't a pressing concern for me at the moment.

Hah, be warned though you are entering "architecture astronaut" territory as far as what others on JGO think about these topics..  Roll Eyes  One can spend a good deal of time on this subject and not create a game, etc.
29  Discussions / General Discussions / Re: Microsoft to buy Mojang for $2 billion? on: 2014-09-16 21:26:17
In respect to JGO... I just keep thinking... Who's next here; this rodeo ain't over...  Shocked
30  Game Development / Newbie & Debugging Questions / Re: Best practices for passing variables around on: 2014-09-15 10:10:31
I think I understood some of what you were saying Catharsis...

I'm trying to split everything up into different packages so hopefully this will solve itself in time.  When I first started out I was just hacking together bits to make them work first then moving them to other places when the needed :/

The rabbit hole goes quite deep; sounds like you are relatively new to Java dev! Welcome! As things go it does take a bit of diligence to write clean code. It's a journey for sure.

The generics / generic method aspects are the doorway to advanced Java coding. Very powerful, but it can take a while to get a handle on what is really possible. You'll mostly see generics referenced as parametrized types for say collections: ArrayList<String>, etc. The cool thing is that in the method above which is a generic method you can use "resourceType"  as a key in a Map to retrieve the count of that resource type as a value of the map and pass it back. It's nice because with just a little bit of code you can then support an ever expanding amount of resource types.

Splitting things up in packages won't immediately solve interdependencies. It's a good idea to create separate packages for different functional areas of your code base.

For example of common interfaces, I have an AI package that contains a static PathFinder class that anything can then call like PathFinder.getPath().

That's not actually an interface, but a static method on a particular class. It's actually quite fragile because there is only one implementation of getPath(). If at some point you wanted to support two or more path finding implementations say for different units it would be hard to accomplish this with a static method unless you passed in more variables to getPath(). It's even worse because the getPath method would get increasingly complicated.

A general tip: usually you want to limit variables passed through methods to no more than 5 for style and practical purposes.

There is a classic design pattern called the Singleton. I won't go into it as you can Google for it. It is definitely no longer in vogue for many reasons and is generally considered an "anti-pattern".

A Java interface provides a contract, but not the implementation. The nice thing about that is that if you can narrow things down to passing around interfaces between functional areas of your code and then at any time provide a different concrete implementation.

'll keep plugging away and try to remove the Game references, I got rid of a few last night and just pass in the Game object when running update methods

That is a good idea / direction to take!  Smiley Consider making an interface for the Game class and passing that around in your update method which should also be defined as an interface.

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  
72  
73  
74  
75  
76  
public interface IUpdateTick
{
   void update(IGame game, float deltaTime);  // Lets say deltaTime is in seconds...
}

public interface IGame
{
    IResourceManager getResourceManager();
}

public interface IResourceManager
{
    <T> int getCount(int x, int y, Class<T> resourceType);
}

public interface IEntity extends IUpdateTick
{
     boolean addSystem(Object system);

     int getX();

     int getY();
}

public class Entity implements IEntity
{
   private ArrayList<IUpdateEntityTick> updatableObjects

   public boolean addSystem(Object system)
   {
      if (system != null && system instanceof IUpdateEntityTick && !updatableObjects.contains(system))
      {
          updatableObjects.add((IUpdateEntityTick)system)
          return true;
      }
      return false;
   }

   public void update(IGame game, float deltaTime)
  {
     for (int cntr = 0, size = updatableObjects.size(); cntr < size; cntr++)
    {
        updatableObjects.get(cntr).update(game, this, deltaTime);
    }
  }
}

public interface IUpdateEntityTick
{
   void update(IGame game, IEntity entity, float deltaTime);
}

public class TreeChopResourceHandler implements IUpdateEntityTick
{
   float timeSinceLastTreeCut = 0;

   public void update(IGame game, IEntity entity, float deltaTime)
  {
      // Potentially cut a tree every 5 seconds...
      if (timeSinceLastTreeCut > 5)
      {
         IResourceManager resourceManager = game.getResourceManager();
         int count = resourceManager.getCount(entity.getX(), entity.getY(), Tree.class);

         // Only cut trees if there are a lot of them! ;P
         if (count > 50)
         {
            timeSinceLastTreeCut = 0;
         
            resourceManager.decrease(entity.getX(), entity.getY(), Tree.class);
         }
      }

      timeSinceLastTreeCut += deltaTime;
   }
}


Don't take the above as the way to do it.. Just some psuedo-code showing interfaces and a more concrete example.. There are problems with the code above like how do you remove TreeChopResourceHandler from an Entity. The neat thing though is that you can now add the tree chop behavior to any Entity regardless of unit type.
Pages: [1] 2 3 ... 8
 

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

The first screenshot will be displayed as a thumbnail.

Longarmx (39 views)
2014-10-17 03:59:02

Norakomi (29 views)
2014-10-16 15:22:06

Norakomi (24 views)
2014-10-16 15:20:20

lcass (28 views)
2014-10-15 16:18:58

TehJavaDev (57 views)
2014-10-14 00:39:48

TehJavaDev (56 views)
2014-10-14 00:35:47

TehJavaDev (47 views)
2014-10-14 00:32:37

BurntPizza (64 views)
2014-10-11 23:24:42

BurntPizza (36 views)
2014-10-11 23:10:45

BurntPizza (78 views)
2014-10-11 22:30:10
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

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