Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (707)
Games in Android Showcase (206)
games submitted by our members
Games in WIP (781)
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 / 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.
2  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.
3  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.
4  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
5  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.
6  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?
7  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.
8  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.
9  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).
10  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
}
11  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.
12  Discussions / Miscellaneous Topics / Re: What I did today on: 2016-12-11 18:23:07
Reflowing solder connections.
13  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.
14  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
15  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
16  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?

17  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.
18  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?
19  Discussions / Business and Project Management Discussions / Re: Crowdfunding in 27 Easy Steps video on: 2016-12-02 16:03:59
There's 'friends' and there's a target audience, and there's people with such frustrations with their current solution, that they are willing to invest in something unproven.

To me it's no surprise that merely sub-1% of JGO's active members, and sub-1% facebook friends were interested in TyphonJS. 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. Either way I think that kickstarter mainly works for feel-good campaigns: if you can't amaze people or put a smile on their face, you'd going to have a tough ride.
20  Games Center / WIP games, tools & toy projects / Re: Forest audio ambience on: 2016-11-10 19:04:27
Why don't you share some of the generated audio as files.

For games we have screenshots, to lower the effort of getting a feel for the project - same could be done here (i'm on my phone, couldn't run a jar to save my life...)
21  Discussions / General Discussions / Re: Hard shadows in real life on: 2016-11-06 11:09:00
Actually, true hard shadows should be impossible due to light diffraction close to the edge of the surface. Photons also have wave characteristics.
Sure, I realized that, but wasn't sure it was in the scope of this question - this seems like a lame excuse, but it's true Smiley
22  Discussions / General Discussions / Re: Hard shadows in real life on: 2016-11-05 09:12:40
If the photons do not diverge, there is nothing smooth about shadows.

If the sun would be a massive grid of parallel lasers pointing at earth, and we would have no athmosphere to scatter the photons, each part of any object on earth would only receive light from one of these laser beams, which would make them either fully illuminated or fully occluded.
23  Discussions / General Discussions / Re: Hard shadows in real life on: 2016-11-04 21:26:18
You assume perfectly radial attentuation: photons moving apart.

Now think lasers.
24  Game Development / Newbie & Debugging Questions / Re: Multi thread Memory Visibility inside Synchronized keyword on: 2016-11-04 20:24:45
Usually you can greatly simplify inter-thread communication by using queues (like ArrayBlockingQueue).
25  Game Development / Newbie & Debugging Questions / Re: Multi thread Memory Visibility inside Synchronized keyword on: 2016-11-04 14:47:24
is 10 value guaranteed to be visible to all other threads?
Nope, it isn't.

The synchronized keyword on the SunSync's run() method also won't help you here. If other threads would, however, synchronize with that RunSync instance, it would be properly synced between threads.
26  Game Development / Newbie & Debugging Questions / Re: Polygon corners with GL_LINE on: 2016-11-01 17:56:54
where is glEnd() ?
27  Discussions / General Discussions / Re: All threads marked as read on: 2016-11-01 14:40:04
This is an SMF bug Sad It has stricken me too a few times over the years.
28  Java Game APIs & Engines / OpenGL Development / Re: Vertex cache shenanigans 2 - WTF, Nvidia??? on: 2016-10-27 21:26:09
I'd say that vertex-caches are never overwritten, because the GPU is this async machine that will be reading that vertex data long after the indexed geometry is processed by the vertex-shader. Allocating a new vertex-cache upon filling one seems almost the only option...?
29  Java Game APIs & Engines / Engines, Libraries and Tools / Re: Generic Multiplayer Connector on: 2016-10-24 04:55:46
For example, once the client has called connect() and joinGame(), they can just call "sendStringDataByTCP(myJsonData)" whenever they want to.  All the other clients will then receive the data with the dataReceivedByTCP() method in the interface.  Those 4 methods are literally the only ones that need to be used to send data between clients.
So this is basically a simplified text based broadcast protocol? I wouldn't consider a single pub/sub-channel a proper base to implement multiplayer.
30  Discussions / Miscellaneous Topics / Re: What I did today on: 2016-10-14 21:35:10
I'm thinking of trying to get past the zoom level inhibited by the precision of a double.

Are you sure? That's quite a trip down the rabbit hole persecutioncomplex
Pages: [1] 2 3 ... 308
 
Galdo (270 views)
2017-01-12 13:44:09

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

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

0AndrewShepherd0 (832 views)
2016-12-15 21:50:57

Lunch (967 views)
2016-12-06 16:01:40

ral0r2 (1199 views)
2016-11-23 16:08:26

ClaasJG (1300 views)
2016-11-10 17:36:32

CoffeeChemist (1323 views)
2016-11-05 00:46:53

jay4842 (1408 views)
2016-11-01 19:04:52

theagentd (1221 views)
2016-10-24 17:51:53
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!