Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (715)
Games in Android Showcase (214)
games submitted by our members
Games in WIP (788)
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 ... 78
1  Discussions / Miscellaneous Topics / Re: What I drew today on: 2017-03-04 20:29:25
Wanted to draw my daughter... somehow ended up as a Scarlett Johannson lookalike Roll Eyes But I still like the outcome:
2  Game Development / Newbie & Debugging Questions / Re: Making shader 2D on: 2017-02-16 12:45:48
I don't use SLick2D, but it is implemented on top of LWJGL. It also seems to have support for shaders:
http://slick.ninjacave.com/forum/viewtopic.php?p=30305

More on GLSL shaders: https://www.opengl.org/sdk/docs/tutorials/TyphoonLabs/

You could do some of the effects you need with clever vertex animation, but in the end, learning GLSL is worth it, even if the learning curve looks a bit steep in the beginning.
3  Game Development / Newbie & Debugging Questions / Re: [Java] [Generics] How to search for a Subtype inside a Generic Collection? on: 2017-02-11 00:54:41
http://www.java-gaming.org/topics/getting-rid-of/37987/msg/363355/view.html#msg363355
4  Game Development / Game Play & Game Design / Re: Too much abstraction? on: 2017-02-08 23:34:02
By type safety, I meant my ECS returning null for objects. Any accessor can return null but that's usually a bug and/or can be prevented. For ECS, you cannot easily prevent someone from removing a component because you cannot remove mutators w/o breaking your ECS.
1. Who is "someone" removing objects from your code? Hackers? Plugin devs?
2. Have an additional component map that does not allow removal or overwriting for components you want to keep in your entity.
5  Java Game APIs & Engines / OpenGL Development / Re: Simple, solid Collada parsing on: 2017-02-08 19:41:39
There is also http://xith.org/javadoc/jagatoo/index.html?org/jagatoo/loaders/models/collada/COLLADALoader.html. I think it is not widely used and outdated, but it's standalone and might be able to serve as a converter.
6  Discussions / Miscellaneous Topics / Re: Saving, loading—oh no! Semi-tutorial discussion holy piñata thing on: 2017-02-06 18:18:44
As I said, use a datamodel. For derived data, use transient and recompute the field in readObject() or readResolve().

Btw. the danger of serializing a memory image is real when you use libs like xstream, that don't require classes to implement Serializable.
7  Discussions / Miscellaneous Topics / Re: Saving, loading—oh no! Semi-tutorial discussion holy piñata thing on: 2017-02-06 11:08:03
In my opinion, serialization is a dangerous thing to use for saving games.

(...)

Good, but then in a next version, you decided to refactor numCarsImpounded into numCarsCaptured or something for instance. When you release this version, you'll also introduce a bug, a major issue. All the existing player's game saves will be lost as serialization will fail.

This has to be solved by testing your load/save code and proper implementation of readObject() or readResolve(). Like Cas said - it would be the same, just in a different place, if you load and set values from xml/json files.

If you want to have some readable format, you can also go with the likes of xstream instead of plain java serialization.

Just make sure, you implement some kind of self contained model for your savegame, so that you don't accidently safe the whole memory image of your game Wink
8  Discussions / Miscellaneous Topics / Re: What I drew today on: 2017-02-06 09:14:42
Didn't turn out like I hoped, so I lost interest to do shading, but hey:
9  Java Game APIs & Engines / Engines, Libraries and Tools / Re: Ongoing project: Type-Safe access to ByteBuffers on: 2017-02-05 13:34:27
Did you see http://www.java-gaming.org/topics/once-again-fast-mappedobjects-implementation/18852/view.html?
10  Game Development / Newbie & Debugging Questions / Re: Obfuscating assets on: 2017-02-01 10:35:43
A long long time ago:
http://www.java-gaming.org/topics/dll/13342/msg/106567/view.html#msg106567
11  Game Development / Newbie & Debugging Questions / Re: Obfuscating assets on: 2017-02-01 10:22:32
Isn't there a way to make it so my assets in a distributed game aren't just grab-able by the user from the explorer folder? What is this called and how do I do it?

I couldn't really find any information on it, yet I could have sworn this is a legit thing in games and other software.
Just don't bother. If they are so good that somebody want's to grab them, be happy. If they make a ton of money using them, just sue them.

There is no thing like client side security. All you can do is raise the bar, but in the end you are just hindering fans to do fan-art (free advertisement) and won't be any hurdle for real crackers anyway...
12  Discussions / Miscellaneous Topics / Re: What I did today on: 2017-02-01 08:35:37
I took a break from developing my game engine and I finished a song I've been working on for a while Smiley
https://soundcloud.com/coldstream24/dreams-of-empty-skies

Do any of you produce music?
Yes, was doing some Renoise stuff (Tracker) in the past, but nothing public. Then bought a Novation Circuit to jam with my friends (https://youtu.be/5MhOYv-ymYU) and recently bought myself a present in form of an Ableton Push 2.
13  Java Game APIs & Engines / Engines, Libraries and Tools / Re: Advantages of Ant? on: 2017-01-27 14:52:21
IME having external dependencies in a build is a bit like building your castle on sand. The build must always succeed. Discuss.
This is actually only a mild problem with maven and gradle. If you want to see this problem in an apocalyptic scope, use npm Shocked
14  Java Game APIs & Engines / Engines, Libraries and Tools / Re: Advantages of Ant? on: 2017-01-26 14:26:15
That scar thing looks like the best idea tbh.
Nah
1  
2  
3  
4  
5  
6  
7  
name: AwesomeLib
source:
    - src
    - other
---
System.out.println("The document data can be any text, ");
System.out.println("but is a convenient place to put code.");

... aaaaand there goes IDE support out of the window.

Seriously, these days it makes much more sense to start with Gradle.
+1
15  Discussions / Suggestions / Re: Add a link to the embedded youtube video on: 2017-01-13 15:46:34
@kevglass Smiley this was targeted at @riven, but indeed was caused by me wanting to see your video. Cheers!
16  Discussions / Suggestions / Add a link to the embedded youtube video on: 2017-01-13 15:38:23
My linux browser crashes, when I activate flash  Roll Eyes
So just rendering a youtube link under the embedded video player would be great.
Thanks Pointing
17  Game Development / Newbie & Debugging Questions / Re: getting rid of "instanceof" on: 2017-01-13 12:59:36
@cylab - I use that "pattern" a lot, but then it's basically the same as the Lookup mechanism in the NetBeans platform.  Not sure if it's the fastest approach, but it's definitely one of the nicer ones.  Smiley
Yupp. Can't deny my Netbeans RCP past...


1  
entities.forEach(e ->  e.with(PoisonGasEffect.class, h -> h.onPoison(1)));

For the sake of completeness, this is, how Entity would look like, then:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
abstract class Entity {
    private Map<Class<?>, Object> handlers = new HashMap<>();

    protected <T> void register(Class<T> type, T instance) {
        handlers.put(type, instance);
    }

    public <T> boolean supports(Class<T> type) {
        return handlers.containsKey(type);
    }

    // support java 8 style optional lambda execution
    public <T> void with(Class<T> type, Consumer<T> consumer) {
        T handler = type.cast(handlers.get(type))
        if(handler != null)
            consumer.accept(handler);
    }
}
18  Game Development / Newbie & Debugging Questions / Re: getting rid of "instanceof" on: 2017-01-13 09:51:58
I don't get the "breaking encapsulation" part here.

Well, from GoF -

Quote
Visitor's approach assumes that the ConcreteElement interface is powerful enough to let visitors do their job. As a result, the pattern often forces you to provide public operations that access an element's internal state, which may compromise its encapsulation.

This made me think, if a more component like approach using a heterogeneous container would be desirable here:

Define what actually can happen in your game as interfaces
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
@FunctionalInterface
interface PoisonGasEffect {
    // this way, you can even require signatures for your effects
    void onPoison(int toxicity);
}

@FunctionalInterface
interface SmartBombEffect {
    void onSmartBomb();
}


Putting a registy in your Entity baseclass would allow for using composition to model the entities behaviour
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
abstract class Entity {
    private Map<Class<?>, Object> handlers = new HashMap<>();

    protected <T> void register(Class<T> type, T instance) {
        handlers.put(type, instance);
    }

    public <T> boolean supports(Class<T> type) {
        return handlers.containsKey(type);
    }

    @SuppressWarnings("unchecked")
    public <T> T getHandler(Class<T> type) {
        return (T) handlers.get(type);
    }
}


Using Java 8, you can define the effects on your Entities with relative ease:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
class Monster extends Entity {
    public Monster() {
        register(SmartBombEffect.class, () -> kill());
        register(PoisonGasEffect.class, (toxicity) -> kill());
    }
    void kill() { /* ... */ }
}

class FriendlyMonster extends Monster {
    public FriendlyMonster() {
        register(SmartBombEffect.class, () -> {}); // this basically "overrides" the effect in the _unfriendly_ Monster
        register(PoisonGasEffect.class, (toxicity) -> damage(toxicity));
    }
    void damage(int points) { /* ... */ }
}

class Arrow extends Entity {
    public Arrow () {
        register(SmartBombEffect.class, () -> remove());
    }
    void remove() { /* ... */ }
}


This works also in a more traditional way:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
class Player extends Entity {

    // or if you want to...
    private class MyUberHandler implements SmartBombEffect, PoisonGasEffect {

        public void onPoison(int toxicity) {
            damage(toxicity);
        }

        public void onSmartBomb() {
            System.out.println("HAHAHA - I told you: 'DONT MESS WITH ME!!!!'");
        }
    }

    public Player () {
        MyUberHandler handler = new MyUberHandler();
        register(SmartBombEffect.class, handler);
        register(PoisonGasEffect.class, handler);
    }

    void damage(int points) { /* ... */ }
}


The actual gameloop would then be rid of specific implementations for your Entity - it's up to you, if you consider this a good or a bad thing...
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
// ...
// Poison gas cloud! The effect is encapsulated in the Entity implementation
entities.forEach(e -> {
    if(e.supports(PoisonGasEffect.class))
        e.getHandler(PoisonGasEffect.class).onPoison(1);
});

// Smartbomb! Whatever happens will happen...
entities.forEach(e -> {
    if(e.supports(SmartBombEffect.class))
        e.getHandler(SmartBombEffect.class).onSmartBomb();
});
19  Game Development / Newbie & Debugging Questions / Re: What are you guys using for your GUI? on: 2017-01-12 10:23:54
googling libgdx gui gave me this:
<a href="http://www.youtube.com/v/ELkqiMpvMLA?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/ELkqiMpvMLA?version=3&amp;hl=en_US&amp;start=</a>
LibGDX Scene2D -- UI, Widgets and Skins
20  Discussions / Miscellaneous Topics / Re: What I did today on: 2017-01-04 12:43:58
+1

Really nice!
The shadows are a bit off, though. Maybe you could attach and transform the shadow geometry to the outer-most pixels of the sprite's bottom...
21  Discussions / Miscellaneous Topics / Re: What I did today on: 2017-01-03 08:38:53
Looks fantastic! Nice consistent style and kind of mystic mood. What will the gameplay be?
22  Discussions / Miscellaneous Topics / Re: What I did today on: 2016-12-22 08:13:09
As requested, the trailer for one of our new songs:

<a href="http://www.youtube.com/v/RE6hzPKGMYs?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/RE6hzPKGMYs?version=3&amp;hl=en_US&amp;start=</a>
Nice tight drumming and smooth production. Good job!

The song itself (especially the text and the guitar at the beginning) is a bit too corny for my taste Cool
23  Discussions / Miscellaneous Topics / Re: What I drew today on: 2016-12-12 07:18:58
@basil: these would make a wonderful space shooter!
24  Game Development / Newbie & Debugging Questions / Re: Concurrent Modification when changing maps? on: 2016-12-11 09:31:35
OP doesn't seem interested anyways...
25  Game Development / Newbie & Debugging Questions / Re: Concurrent Modification when changing maps? on: 2016-12-09 23:44:08
No, when ArrayList.clear() (not remove, not add: clear!!) fails with ConcurrentModificationException, the current thread is not also adding/removing *during* the clear, hence another thread is, hence the proof.

I doubt, the CME was raised in clear(). We didn't see a stacktrace from OP, so I still bet it's while adding to the itemList...
26  Game Development / Newbie & Debugging Questions / Re: Concurrent Modification when changing maps? on: 2016-12-07 08:09:31
You really need to add stacktraces and correct line numbers to this sort of questions. This way we are just guessing.

But since I am usually good at guessing, I'll give it a try: could it be, that you are adding items to the collisionObjectsLayer, when you are adding them to the ItemManager.itemList?
27  Discussions / Miscellaneous Topics / Re: What I did today on: 2016-11-26 00:07:20
I put in the buttons on my arcade cabinet.  It's coming along nicely!  The buttons all worked right away, so that was cool.
Nice cabinet, but are you sure, that you put in the panel in the right orientation? From the curve of the buttons, I would guess, they need to be the other way around...  persecutioncomplex
28  Discussions / Miscellaneous Topics / Re: What I did today on: 2016-11-18 06:48:24
Uploaded a Jam I had with my buddies 3 weeks ago: <a href="http://www.youtube.com/v/5MhOYv-ymYU?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/5MhOYv-ymYU?version=3&amp;hl=en_US&amp;start=</a>
I am the guy in the back on the right abusing the Novation Curcuit Cool
29  Discussions / Miscellaneous Topics / Re: What I did today on: 2016-11-13 11:03:20
+1 for Altered Beast. Hope it's not just nostalgia tricking my memories...
30  Discussions / Miscellaneous Topics / Re: What I did today on: 2016-11-09 08:07:21
Say you were looking to execute a java program via the command line. You first try to get the version of a potential java installation:
java -version
. Say the output is
'java' is not recognized blah blah blah
. Now you'd like to try and see if you can find a JRE or JDK installation directory somewhere on the computer from which to execute the program without downloading a full JRE. Alright. Would you say that looking for
%JAVA_HOME%
or
$JAVA_HOME
help, or would that be overkill since java is not on the path?

J0 Smiley

Just dont. Bundle your own jre. Will save you a ton of headache...
Pages: [1] 2 3 ... 78
 
CopyableCougar4 (116 views)
2017-03-24 15:39:42

theagentd (98 views)
2017-03-24 15:32:08

Rule (159 views)
2017-03-19 12:43:22

Rule (147 views)
2017-03-19 12:42:17

Rule (151 views)
2017-03-19 12:36:21

theagentd (165 views)
2017-03-16 05:07:07

theagentd (161 views)
2017-03-15 22:37:06

theagentd (134 views)
2017-03-15 22:32:18

theagentd (128 views)
2017-03-15 22:31:11

ral0r2 (155 views)
2017-03-03 11:52:41
List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05

SF/X Libraries
by SkyAphid
2017-03-02 06:38:56

SF/X Libraries
by SkyAphid
2017-03-02 06:38:32

SF/X Libraries
by SkyAphid
2017-03-02 06:38:05

SF/X Libraries
by SkyAphid
2017-03-02 06:37:51
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!