Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (710)
Games in Android Showcase (212)
games submitted by our members
Games in WIP (785)
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 ... 308
1  Game Development / Performance Tuning / Re: Quadtree Efficiency? on: 2017-02-22 13:58:38
Grids are extremely fast and trivial, but you need to spend some time tweaking them when you have objects with negative positions. Since you'll typically implement them as 2D arrays, negative indices will be a problem.

You just add a value to the coords to ensure they are positive... you'll never need negative cell index logic.
2  Game Development / Newbie & Debugging Questions / Re: mt object wouldnt load image on: 2017-02-22 07:38:06
Not sure why you think you have to use "//" -- did you see "\\" and attempt to swap the slashes to make it cross-platform? Simply use "/"

That will be the first step to solve your problem. This thread will help you with the next steps:
http://www.java-gaming.org/topics/faq-cannot-find-the-resource-file/33226/view.html
3  Game Development / Performance Tuning / Re: Quadtree Efficiency? on: 2017-02-22 07:18:07
Use grids. They have a lot less cache-trashing, and the logic is trivial. You will have quite a lot of empty cells, but that's OK.
4  Java Game APIs & Engines / Engines, Libraries and Tools / Re: Ongoing project: Type-Safe access to ByteBuffers on: 2017-02-11 13:27:22
Yes. Pointing
5  Java Game APIs & Engines / Engines, Libraries and Tools / Re: Ongoing project: Type-Safe access to ByteBuffers on: 2017-02-11 11:37:13
I've reviewed existing approaches related to this topic.

http://homac.cakelab.org/projects/org.cakelab.nio/existing.html


I think I've found everything about it, but if someone knows about a tool or framework I haven't mentioned, please tell me.

Quite an impressive review!


Quote
@StructField: Used to declare a field to be part of the struct. Fields without it will be considered to be transient in respect to the structs layout.
@CopyStruct: Used to declare methods to return a copy of the struct.
@TakeStruct: Used to declare methods which take a parameter, which is a mapped struct object.

@CopyStruct and @TakeStruct both refer to the return-value (unrelated to parameters). It is basically an instruction to the callsite, on whether to copy the struct that was returned to the head of its stack (in case it was stack allocated in the called method), or take it as is (in case the struct was malloc-ed or pre-existing, surviving the scope of the callee).
6  Java Game APIs & Engines / Engines, Libraries and Tools / Re: Ongoing project: Type-Safe access to ByteBuffers on: 2017-02-05 14:09:11
LibStruct is zero-copy. You just map a struct to an existing memory pointer / buffer
7  Games Center / Contests / Re: Urgent announcement about java4k.com on: 2017-02-04 21:19:31
So I don't like registering domains anymore, because if u choose to move on then someone will swoop in and take up whatever u were doing.

You could have spared yourself this outcome by handing over the domain to those who offered, I vaguely recall I wasn't the only one. You already stated that you wished to handover the site, but that there were no takers, so it was your intent to see a continuation of the java4k site. Why did you choose not to take the offer, let the domain expire and expose it to the trolls?
8  Java Game APIs & Engines / OpenGL Development / Re: LWJGL-3 What is the best way to make a voxel engine? on: 2017-02-03 20:10:15
We have a dedicated sub-board for Cube World Projects Pointing

http://www.java-gaming.org/boards/cube-world-projects/83/view.html

You'll find a lot of discussion about the topic!
9  Games Center / Contests / Re: Urgent announcement about java4k.com on: 2017-02-03 16:13:40
How is this hacking? Somebody abandoned a domain, they bought it - at most this is copyright infringement, I think.
10  Discussions / Miscellaneous Topics / Re: Retrieve random point inside regions of Perlin noise? on: 2017-02-01 17:08:51
Use floodfill indeed. And drop the requirement that your game is supposed to be infinite. Not a single gamer cares about infinity Smiley

Try to make a relatively small world, and make a fun, functioning game - that is hard enough!
11  Games Center / Contests / Re: Urgent announcement about java4k.com on: 2017-02-01 09:16:24
Some months ago I let the domain expired, the contest had been dead for 3 years. I had offered to others to adopt it but no takers.

Hey, I offered to be your fallback volunteer Smiley



http://www.java-gaming.org/topics/should-i-let-java4k-die/36852/msg/351025/view.html#msg351025

If, and only if, there are no suitable volunteers, please extend the domain registration, I will reimburse you. Once that is done, we can take some time to transfer ownership of the domain & website.

IMHO java4k.com should stay online if only for historical reasons.
12  Game Development / Newbie & Debugging Questions / Re: Lighting whoes on: 2017-01-31 08:24:37
@JESTERRRRRR, yes, light is cumulative.
13  Game Development / Newbie & Debugging Questions / Re: Libgdx HTTPRequest on: 2017-01-10 22:44:45
Note sure what you mean, as CORS is not used for <img src="..."> requests, and is used for ajax-calls with specific http-methods and non-trivial http-headers. So it does not stop content leeching of images and I'm not sure how many people leech content through the ajax API... Smiley

In earlier versions of Chrome, you could disable CORS with the CLI param:
--disable-web-security


Anyhoo, this is a tad offtopic. If you wish to elaborate I could split it off this topic.
14  Game Development / Newbie & Debugging Questions / Re: Libgdx HTTPRequest on: 2017-01-09 18:02:46
CORS is actually a security measure, not a way to block content leeching.
15  Game Development / Performance Tuning / Re: Tips for reducing frame rate spikes due to JIT early in a game? on: 2016-12-26 17:42:14
Shouldn't we go back to the original post and wonder whether all assertions are correct?

A 1000ms JIT pause is highly unlikely, given that the JIT does its work incrementally.


I bet it's a code path that the OP isn't expecting, triggering a lot of disk I/O, the incorrect initialisation of a data-structure, etc etc.

If you simply profile your code (and use System.currentTimeMillis / System.nanoTime to confirm your suspicions) you'll most likely find the culprit quite quickly.
16  Discussions / Miscellaneous Topics / Re: What I drew today on: 2016-12-20 12:42:36
You forgot the cheekbones and the fat/muscles in the cheeks. That is how mere human brains determine age quite accurately. Your brain told you she has smooth skin, so you didn't draw anything there. Shading, implying some curves will solve your problems Smiley
17  Game Development / Newbie & Debugging Questions / Re: Delay Line of Code for X Amount of Seconds on: 2016-12-19 07:35:28
I guess that you didn't completely understand what Riven said, you seem to not understand the logic. He just gave you the core logic. While it works in the raw form, you can make your life easier by introducing a
GameTimer
class.

1  
2  
3  
4  
5  
6  
public GameTimer(long millis, boolean loop, Runnable action)
{
    this.millis = millis;
    this.loop = loop;
    this.action = action;
}

We take the number of milliseconds to wait, whether to keep running or stop after the first run, and an action, which is a Runnable which can be invoked later when the time expires. Now, we just need start and stop methods so we can control the timer whenever we want.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
public void start()
{
    this.elapsed = 0;
    this.active = true;
}

public void stop()
{
    this.active = false;
}

This is simple enough, we have the basic encapsulation of the timer. All we need now is the core logic of the timer. We'll do it in the update method of the timer.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
public void update(long elapsedMillis)
{
    if (!active) return;

    elapsed += elapsedMillis;

    if (elapsed >= millis)
    {
        action.run(); // Run the action
        stop();

        // If in loop, start the timer again
        if (loop)
            start();
    }
}

That is all there is to it. Just update the timer object every time you update the game along with your objects and you are done.

I'd actually be (mildly) against this abstraction layer. The more complex your game gets, the more trickery is involved adjusting the internal state of the timers. In the end you are going to expose all fields with getters and setters and your abstraction layer is getting in the way.
18  Game Development / Newbie & Debugging Questions / Re: Delay Line of Code for X Amount of Seconds on: 2016-12-18 10:34:23
1  
2  
3  
4  
5  
6  
7  
8  
public static final int HZ = 60;

private int countdown = 0;
private int state = 0;

public void update() {
   ... [snipped]
}

This works brilliantly! One problem though, I can't seem to find a way to reset the two integers for the next level. I tried setting them back to 0 after the if statement that checks the level, but it just keeps looping again.
You can make your state-machine as advanced as you want. You can even introduce an integer for 'level', but it might be better to create a new Level class with it's own update-logic with a unique state-machine. I'm not sure what the problem is that you describe, what is wrong with looping? Once the two integers are reset to zero, it will restart all logic. Is this not desired?
19  Game Development / Newbie & Debugging Questions / Re: Delay Line of Code for X Amount of Seconds on: 2016-12-16 16:13:02
To avoid the time-sensitive issues with pauses, and other time related oddities Cas (of puppygames' fame) introduced me into the wonderful world of counters. Just get your game to run at 60fps, always. (this may be a barrier, but it's one of the best investments for your game). Then, when you need to schedule an action, you'd just do:

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  
public static final int HZ = 60;

private int countdown = 0;
private int state = 0;

public void update() {
   if(countdown == 0) {
      if(state == 0) {
         doThingX();
         countdown = 3 * HZ; // reach state=1 in 3sec
      }
      else if(state == 1) {
         doThingY();
         countdown = 30 * HZ; // reach state=2 in 30sec
      }
      else if(state == 2) {
         doThingZ();
         countdown = 10 * HZ; // reach state=3 in 10sec
      }
      state++;
   }
   countdown--;

   // do your typical update-stuff
}


Make it as complicated as your heart desires. You can have multiple counters, states that freeze counters until a certain condition is met, etc etc. You end up with a (fully deterministic) state-machine.
20  Discussions / Business and Project Management Discussions / Re: Crowdfunding in 27 Easy Steps video on: 2016-12-14 15:01:10
Awww... I should really stop reading these replies, you're making me feel sick.
21  Game Development / Performance Tuning / Re: Has anyone tried creating an optimized HashMap implementation? on: 2016-12-13 22:55:22
A similar strategy is to have N hash-functions, to calculate N possible key indexes. If the first is full, try the second, until you arrive at N, and are forced to expand your backing table. This is less wasteful, but causes lots of cache misses (but not more than a linked list).
22  Game Development / Performance Tuning / Re: Has anyone tried creating an optimized HashMap implementation? on: 2016-12-13 22:41:11
Sure, give each slot (derived from the hashcode) N keys and values.

Once the slot overflows, it's likely you have to grow your backing table, or you fall back again to (linked) lists for keys beyond N.

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  
private int calcSlot(int hashcode) {
    // precompute, and keep both keys.length and N POT,
    // to allow for some bit-magic. you'd just zero out some lower bits.
    return hashcode % (keys.length / N);
}

public V get(K key) {
    int slot = calcSlot(key.hashCode()) * N;
    for(int i=0; i<N; i++) {
      K got = keys[slot + i]; // could be null, who cares
      if(key.equals(got)) {
         // would be tempting to swap keys[slot+0] and keys[slot+i] here, for future lookups
         return vals[slot + i];
      }
    }
    return null;
}

public void put(K key, V val) {
    int slot = calcSlot(key.hashCode()) * N;
    for(int i=0; i<N; i++) {
      K got = keys[slot + i]; // could be null, treat as free
      if(got == null || key.equals(got)) {
         keys[slot+i] = key;
         vals[slot+i] = val;
         return;
      }
    }

    // dreadful logic here
}
23  Game Development / Performance Tuning / Re: Has anyone tried creating an optimized HashMap implementation? on: 2016-12-13 22:25:42
I tried, with moderate success. Even if you make the logic 10x as fast as HashMap, the L1 cache misses are going to ruin the party. If you can make any assumptions about how your lookups are grouped, try to make those keys fit in common pages. If you want performance, your data-structures will have to be highly specialized - I wouldn't expect a drop-in replacement of HashMap that was more than 10% faster in real-world cases.

I wrote a binary-search algorithm some time ago that had hardly any cache-misses (which is the last hing you'd expect from binary-search on an array), as it used a layered binary-search, should be here on JGO - I'll look it up here it is.
24  Discussions / Miscellaneous Topics / Re: What I did today on: 2016-12-11 18:23:07
Reflowing solder connections.
25  Discussions / Business and Project Management Discussions / Re: Crowdfunding in 27 Easy Steps video on: 2016-12-11 12:27:03
How can i possibly convince one of anything when they have this sentiment:
Quote
I simply don't believe you intended to be helpful
and many similar remarks going just short of saying what a terrible person I am.

You seriously seem to hold a grudge, resulting in an unprecedented series of insults and insinuations. I don't think our conversation here leads to something constructive. Eventhough my fingers are itchy to type up a reply, elaborating on misconceptions and differences of perspective,  I'll leave it at that. Goodluck with your project.
26  Game Development / Newbie & Debugging Questions / Re: Concurrent Modification when changing maps? on: 2016-12-10 22:35:11
At no point was I even mildly distressed by your remarks Pointing
27  Game Development / Newbie & Debugging Questions / Re: Concurrent Modification when changing maps? on: 2016-12-10 20:31:33
Nope! He just poked fun of me, given that I failed miserably Smiley
28  Game Development / Newbie & Debugging Questions / Re: Concurrent Modification when changing maps? on: 2016-12-09 22:47:56
This PROVES multiple threads are modifying the ArrayList.
No, it just proves he's trying to iterate through a list at the same time as adding or removing things to it.
The classic mistake: [snip]

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.

Using an iterator doesn't work, using ArrayList.clear() doesn't work either. Iv'e exhausted all my options as a nub, what gives?

29  Game Development / Newbie & Debugging Questions / Re: Concurrent Modification when changing maps? on: 2016-12-08 21:19:59
Using an iterator doesn't work, using ArrayList.clear() doesn't work either.
You said in your opening post that ArrayList.clear() fails with ConcurrentModificationException.

This PROVES multiple threads are modifying the ArrayList.
30  Discussions / Business and Project Management Discussions / Re: Crowdfunding in 27 Easy Steps video on: 2016-12-02 20:34:56
To me it's no surprise... That you continue to be critical without actually being constructive for the most part. I guess that is just you.

To me it's no surprise that merely sub-1% of JGO's active members, and sub-1% facebook friends were interested in TyphonJS.
So true, classic me!

As mentioned on general principal I back all crowd funding efforts from active JGO members.
I applaud the gesture, but I think it's a bit out there, and one cannot expect people to return that favor. I wouldn't even fund my friends projects blindly, I think that goes for most people, but it might be classic me again.

I read your kickstart, and commented on it previously, on how its content would even have alienated your actual target-audience, but we agreed to disagree on that one.

Actually if you read that post you'll see I listened and did not disagree on relevant points; though you had far more critical and moot musings on it all, but I didn't point that out until now.
My moot musings are the best, I'm glad you finally take the time to set the record straight on this one.

Having no actual budget I could not change the video. Could I have hired a more professional firm for $30-50k sure... Could I have paid PR firms to blast out a perhaps slightly more polished message sure. I did what I could within my means at the time and with the knowledge I have now things will be different on my next go at it perhaps with results to match.
I respect that you sank $10K into that video, but it simply - to me - didn't look like it. I actually think you could have done a better job yourself (this is somewhat of a compliment, you see). The firm that delivered on a budget made some rookie-mistakes IMHO (like that 8 second (!) fade out, in the middle of the video), that I seriously think that *you*, given a day to work on it, could have done it better than what that firm delivered. I wouldn't have invested $10K, not even for the best possible video, mainly because I'm not much of an entrepeneur, and secondly because I'd even find a mere $10K quite a lot of money for a promo video. If regular rates are $30K-50K, then you got a great deal, financially - although I'm still convinced with a bit of effort a more convincing video would have arisen from your own hand in a day or two - for free (or your hourly wage).

Would I make the video differently now; yes... I also know that beating the street and showing demos to ~1000+ people primarily at tech conferences is nebulous in return. It takes multiple impressions to get folks to follow through. The best fruit of all the in person demos came from the Phandroid coverage where several people in the comments brought up meeting me / seeing the demo at the Big Android BBQ which adds confidence from the passer by reading that post.

I was on the leading edge of what was possible at the time (and still now). A bit too early and a buck short. With some small tweaks and a budget of $50-100k things might have been different.
Given that quite a few kickstarters succeed with minimal investment, I think it's more of a hype/goodwill centered issue than a financial one.


There are plenty of other things left unsaid in regard to the difficulty of bootstrapping and working in waves on any creative effort; 13 years and counting. There also was my parents ongoing failing health and a desire to get a moonshot realized before they passed which happened this year. Given the latter alone I took a shot at it...

Either you have the money to blast things out PR wise, get lucky and meet a need; do both... OR you need about ~500 strong advocates who will be active in getting the word out. The latter achieved through hitting the street and doing some sort of alpha / beta early release. That is now possible with Android which wasn't back then; re staged alpha / beta releases via Google Play. For games I'm not sure the whole green light / GOG work in progress release is the way to go per se as it is a bit to uncontrolled.
I'm sorry to hear about your parents.

I'm not sure what actually changed with Google Play though - couldn't you always release a 0.x version of your app and publish it in Google Play? Surely even your alpha/beta version beat a lot of existing 'proper' apps, capability wise, that were in the store, back then?
Pages: [1] 2 3 ... 308
 
numerical (122 views)
2017-02-21 07:32:16

numerical (121 views)
2017-02-21 07:31:46

theagentd (228 views)
2017-02-18 13:42:33

theagentd (229 views)
2017-02-18 13:35:16

h.pernpeintner (1392 views)
2017-01-24 22:39:11

h.pernpeintner (1380 views)
2017-01-24 22:38:32

Galdo (1942 views)
2017-01-12 13:44:09

Archive (2011 views)
2017-01-02 05:31:41

0AndrewShepherd0 (2548 views)
2016-12-16 03:58:39

0AndrewShepherd0 (2318 views)
2016-12-15 21:50:57
List of Learning Resources
by elect
2016-09-09 09:47:55

List of Learning Resources
by elect
2016-09-08 09:47:20

List of Learning Resources
by elect
2016-09-08 09:46:51

List of Learning Resources
by elect
2016-09-08 09:46:27

List of Learning Resources
by elect
2016-09-08 09:45:41

List of Learning Resources
by elect
2016-09-08 08:39:20

List of Learning Resources
by elect
2016-09-08 08:38:19

Rendering resources
by Roquen
2016-08-08 05:55:21
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!