Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (521)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (589)
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
1  Game Development / Artificial Intelligence / Re: Seeded Generated Random Maps on: 2005-03-02 18:36:14
I went to this site:
http://freespace.virgin.net/hugo.elias/models/m_perlin.htm

And implemented a 2D noise function:
     public static double intNoise2d(int x, int y){
           int n = x + y * 57;
           n = n << 13 ^ n;
         return ( 1.0 - ( (n * (n * n * 15731 + 789221) + 1376312589) & 0x7fffffff) / 1073741824.0);  
     }


This gives me values between -1 and 1, which is enough for me. I can generate terrain and trees etc. based on the numbers it gives me.

My question is, how do I seed it? Now it will give me the exactly same map each time.  Grin
2  Game Development / Artificial Intelligence / Re: Seeded Generated Random Maps on: 2005-03-02 06:18:06
I looked at the article and I think I can use the 1 dimensional and 2 dimensional noise he is talking about. Just a small routine question. Is there a Java Perlin Class? I do not want to re-invent the wheel if it is available by a better programmer than myself.  Smiley
3  Game Development / Artificial Intelligence / Seeded Generated Random Maps on: 2005-03-02 05:32:07
I have a client - server situation where I need to generate maps. Rather than sending the entire map to the client I would simply like to send a set of numbers. The client would use these numbers to generate an identical map.

I need an aglorithm that does not need to generate the entire map before I can use it. I need a simple function that only takes a location, e.g.

getTerrain(x,y);
getVegetation(x,y); // would return an integer representing a plant

I need some help, as I don't know where to start. Can this be done?
4  Discussions / General Discussions / Database Questions on: 2005-02-09 11:42:09
I'm working on a database for an online game server. I've been looking into prepared statements and see that they are tied to a specific connection. Should I pool the statements instead of connections If that is all i plan to use? Or should I just use one connection per prepared statement?
5  Game Development / Performance Tuning / Optimizing on Windows 2000 on: 2005-01-20 17:58:47
I have a game server that chokes for 2-3 seconds every now and then. It might have to do with:
1. Garbage collection
2. External programs in Windows hogging memory
3. Unoptimized code

What can i use besides -gc to keep track of garbage collection?

What programs are there that keep a history log of how much memory and CPU programs are using?

What programs can be used to find bottlenecks in code?
6  Discussions / General Discussions / Re: Game server bogging down on: 2005-01-20 04:45:42
Is there some type of profiler software or something?
7  Discussions / General Discussions / Game server bogging down on: 2005-01-18 14:53:45
I have a game server that handles events 10 times per second. However sometimes it starts choking and lagging behind up to 0.5-1 second.

How can I debug whats going on? I need to see what portion of my code is causing problems... Is there a profiler or something?
8  Discussions / General Discussions / The RAM-Monster! on: 2004-10-07 18:34:39
I have a fairly complex application that has started eating RAM. Something like 100 kb/minute. How can I tell what is causing it? I don't know what kind of monster I've unleashed.
9  Java Game APIs & Engines / Tools Discussion / Object Relational Tools on: 2004-06-04 05:58:54
What tool should I use if I want to describe a database in XML and import data into that database using an XML file with a similar node structure?

It would be cool if that tool would work with MYSQL and perhaps make it easy to switch to another database sometime in the future. Maybe a Java driven database?
10  Java Game APIs & Engines / Tools Discussion / Re: Scripting languages on: 2004-06-04 05:39:23
Quote
Exactly - you could type the equation in wrongly such that it was a syntax error. A scripting language won't detect it until runtime. Perhaps it only gets run 2/3rds of the way through the game in an obscure circumstance. This is why we developed compilers!

I still don't get it. Keep talking!

Cas Smiley


Scripting languages are excellent when you want to open up bits and pieces of your game to content developers. This allows them to script NPCs etc. It's about making your game accessible to people that not necessarily are hardcore programmers. Hence I've chosen Rhino as javascript is a common fairly easy to learn language.

I get the impression that some of you work on your projects solo. In that case I agree. Scripting languages are not optimal until you invite creative ppl to extend your game.
11  Discussions / General Discussions / Re: They let the Tiger out on: 2004-02-06 19:52:04
Sweet. Grin
12  Discussions / General Discussions / Re: They let the Tiger out on: 2004-02-06 18:06:23
Sorry for being such a pain, but what's the benefit of static import?
13  Discussions / General Discussions / Re: GageTimer on: 2004-02-06 04:44:51
What should I do instead? Just sit in a tight loop I guess... I think I'll stick with Gage HiResTimer if it allows me to use standard API.  Wink
14  Discussions / General Discussions / Re: GageTimer on: 2004-02-05 16:48:53
Quote
BTW, are you using Thread.sleep() with the Perf timer?


Yea, I'm using Thread.sleep() and the problems occur with windows2000.
15  Discussions / General Discussions / Re: GageTimer on: 2004-02-05 11:51:00
Because Gage and Perf is running on a server and I'm connecting to it with game clients. All game clients work with Gage, all clients complain of straying with Perf. Whatever Gage is doing, its not the same thing Perf is doing.
16  Discussions / General Discussions / Re: GageTimer on: 2004-02-05 09:16:39
Whatever's in sun.misc.Perf it doesnt seem to use a native timer, because over time it strays away compared to GAGE.
17  Game Development / Performance Tuning / Re: The Most Awesomely Useful GC Tuning Tool Ever on: 2004-01-22 13:10:15
I installed it. It looks very cool with all these dials, bars and stuff, but what do they all mean? I couldn't find any extensive documentation. I got no clue what eden is. Where do I start to learn to decipher all of this.

In short:
a) What is it trying to tell me?
b) What should I do about it?
18  Discussions / General Discussions / Java 1.5 Speed improvements? on: 2004-01-22 09:51:12
It seems that much casting will not be needed in 1.5, will this affect performance any?
19  Discussions / General Discussions / Re: GageTimer on: 2004-01-07 18:19:52
Are we talking about the stuff in sun.misc.Perf?
20  Game Development / Newbie & Debugging Questions / Iterator stopped working! on: 2004-01-06 08:07:22
The following code has worked excellent for over a year, and now it stops working:


1  
2  
3  
4  
5  
Iterator itr =  mylist.iterator();
while(itr.hasNext()){                        
      myobject = (MyObject) itr.next();
        mylist.remove(myobject)
}


However if i use: itr.remove() instead it works. Any ideas?
21  Discussions / General Discussions / Re: GageTimer on: 2004-01-02 19:35:53
"Hidden" as in unsupported?
22  Discussions / General Discussions / Re: GageTimer on: 2003-12-29 05:36:08
Thx. Anything in java 1.5 that will help timing issues?
23  Game Development / Performance Tuning / Re: Exceptions slow? on: 2003-12-29 04:05:24
I was thinking of something like this. Any input in contrast to exceptions?

With the below I can do the following:

ResultObject resultobject = doSomething();
if(resultobject.getResult()==null){
      System.out.println(resultobject.getError());
}

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
public class ResultObject{
      private MyObject result=null;
      public MyObject getResult(){
            return result;
      }

      private static int final ERROR_NONE = -1;
      private static int final ERROR_TYPE_MISMATCH = 0;
      private static int final ERROR_TOO_LARGE = 1;
      private int error=-1;
      public int getError(){
            return error;
      }            
}
24  Discussions / General Discussions / GageTimer on: 2003-12-28 14:12:27
I use GageTimer for my game:
http://java.dnsalias.com

However it seems to take much CPU, can anything be done about that?
25  Game Development / Performance Tuning / Re: Exceptions slow? on: 2003-12-27 17:32:34
An alternative would be to return a ResultObject. The exceptions could have static ResultObject(s) thus no new classes would have to be created in comparison to thrown.
26  Game Development / Performance Tuning / Exceptions slow? on: 2003-12-27 09:20:16
What are the caveats of using Exceptions? I heard they were slow and should be avoided. What are the alternatives? Judiciously check all data with if/else statements?
27  Game Development / Newbie & Debugging Questions / Re: Nullify references on: 2003-11-24 17:01:56
Okay, I do my cleanup in a delete() method.

Btw to empty Collections do you:

myArrayList = new ArrayList();

OR

myArrayList=null

Wink
28  Game Development / Newbie & Debugging Questions / Re: Nullify references on: 2003-11-23 11:51:12
Bridges are being built in Sanxions mind!
29  Game Development / Newbie & Debugging Questions / Re: Nullify references on: 2003-11-23 11:09:40
Okay.

I have an instance of Car.
Car has a reference to Engine.
Engine has a reference to Car.

I am done with the Car. I set the Engine in car to null.
If I understand things correctly the Car will not be garbage collected as long as the Engine has a reference to it?

30  Game Development / Newbie & Debugging Questions / Nullify references on: 2003-11-22 19:48:14
I have an application that seems to gallop away in terms of RAM usage. I think it has to do with cleaning up
references.

Is there any way to loop thru the fields of an instance and set them to null?

It would be a start if i could do this on my custom delete() method, to stop circular references.
Pages: [1] 2
 

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

The first screenshot will be displayed as a thumbnail.

xFryIx (52 views)
2014-11-13 12:34:49

digdugdiggy (34 views)
2014-11-12 21:11:50

digdugdiggy (28 views)
2014-11-12 21:10:15

digdugdiggy (23 views)
2014-11-12 21:09:33

kovacsa (46 views)
2014-11-07 19:57:14

TehJavaDev (50 views)
2014-11-03 22:04:50

BurntPizza (49 views)
2014-11-03 18:54:52

moogie (65 views)
2014-11-03 06:22:04

CopyableCougar4 (63 views)
2014-11-01 23:36:41

DarkCart (148 views)
2014-11-01 14:51:03
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!