Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (121)
games submitted by our members
Games in WIP (577)
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  Java Game APIs & Engines / Java Sound & OpenAL / Re: Trouble synchronizing audio with SourceDataLin on: 2004-04-29 07:48:43
EDIT:

Tried this and it's better but not good:
1  
2  
while ((line.getBufferSize() - line.available()) > 0)
  Thread.yield();


Instead of
1  
line.drain();


... Still feel that I would like to read a paper from someone who "had the answers" of how to control SourceDataLines without the latency implied with the drain() method...
2  Java Game APIs & Engines / Java Sound & OpenAL / Trouble synchronizing audio with SourceDataLines on: 2004-04-29 07:02:24
My last topic about the pitching car-engine-sound-thing is solved as far as for the pitching problem.

However - When I stream a sample via a SourceDataLine a lose control of how much of the sample that has "streamed away". I need to know this since I want to loop the engine-sample with a different pitch when the first sample is finished. And thereafter repeating again ang again... Wait until first sample is written before repitching and writing again...

It's just the only way I know of to get that control is to use the drain() method and that gives the sample a small pause between the loops (while drainging). If I don't "wait" for the samples to end before looping them, my engine will keep a certain rpm for a few secs eventhough I hit the brakes...

Soo - concluding - How should a use the SourceDataLine to have control over it and to seamlessly loop and pitch my engine-sample?

Thanx! /Markus

3  Java Game APIs & Engines / Java Sound & OpenAL / Re: Pitch / Bend samples in my cargame? on: 2004-04-28 04:07:37
That would be nice - to see how its done;)

I'm one of those "I-need-to-understand-everything"-persons so I'd still like to read about the stuff you mentioned; Tone-generator and how and where and what and does Java offer any standard-features or do I have to make (or utilize yours) my own tone generator?

I once thought of something like using Java Sound Clip and read my wavs as a big byte []. Could I then pitch the sound by removing every 2:nd / 3:rd byte just as if I where scaling an image?

/Markus
4  Java Game APIs & Engines / Java Sound & OpenAL / Pitch / Bend samples in my cargame? on: 2004-04-27 13:18:36
Hi there!

I'm deleveloping a cargame (2D seen from above driving around in a classic Amiga/C64-style)  and I'd love some nice engine sounds to accompany my cars as they accelerate... Thus; Bending / Pitching in Java? How does it work? Tutorials / Examples? Hints...?

Thanx in advance!
/Markus
5  Game Development / Networking & Multiplayer / Re: Multithreaded server design issues... on: 2004-01-09 09:39:59
Well... In parallel might not have been the best word but I simply mean that while client A is being served, client B and C has to be allowed to connect "at the same time" as A finishes up it's session.

Therefore, each port's main-service-thread (the one that a posted earlier) should have to make a new thread for each connected client so that it can serve even more clients, right? And it's when I do this, that the the SocketChannels decide to die on me Sad

About nio - I honestly don't know enough about it - YET Wink If you have some good examples / links / tutorials I'm all ears! I've been reading a bit about the Selector and all that but I havn't really got the the point where I can say "Ahhh - now I get it" Wink

/Markus
6  Game Development / Networking & Multiplayer / Multithreaded server design issues... on: 2004-01-09 08:52:03
I'm developing a server that has to be able to cope with several (hundreds) clients simultainiousely. Each connection is 100% autonomous (hard word to spell) and there are no "shared resources".

My first, basic implementation was a straight-forward approach following the guidlines from sun's tutorials.

The following code is executed in a separate thread, serving a certain port. I have totally 5 different ports running on the serve, hence 5 threads each serving their individual ports;

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
ServerSocketChannel ssc = ServerSocketChannel.open();
InetSocketAddress isa = new InetSocketAddress(port);
ssc.socket().bind(isa);

while(true)
{
  SocketChannel sc = ssc.accept();

  if (sc != null)
  {
     Service serviceInstance = (Service)service.newInstance();

     serviceInstance.setSocketChannel(sc);
     serviceInstance.start();
  }
}


Service refers to my own abstract class, designed to deal with this typical thread's (port's) behaivour.

So far, so good but since I wanted several clients to be able to connect to the server in parallell (if there is such a thing...), I modified my "serviceInstance" to start a seperate thread to handle its client.

Now this is where it starts to get boring - Suddenly my the SocketChannel closes (stocastically - sometimes it work, sometimes it throws an exception since it closed and I try to read / write to / from it)

Can this be (it seems to but I ask just to get you advice & tips'n'tricks) due to the fact that I use threads? Why does the channel suddenly drop dead?

I think that what I really am looking for in this thread is Your thought of a better approach to solve my problem;

Designing a Java server that has 5 different port open for connections with 5 completely different behaivours, built to cope with at least a couple of hundre clients...

I feel that I'm having trouble to describe my problem correctly, but I hope you understand my situation - sort of Wink

Thanx / Markus
7  Game Development / Networking & Multiplayer / Re: Linux-Server ignors my Clients! on: 2004-01-08 11:10:34
Thanx blahblahblahh (?) for the clarification Wink.  As you said, I've searched the web for two days and found ziltch until you guys came along and explained things!

You learn as long as you live...

Thanx!
8  Game Development / Networking & Multiplayer / Re: Linux-Server ignors my Clients! on: 2004-01-08 10:59:34
No worries! And btw, Thanx for your assistance / support Wink

InetAddress.getLocalHost()[Linux]
 Localhost = localhost/127.0.0.1

InetAddress.getLocalHost()[Windows XP]
 Localhost = murdockian/192.168.12.42

ifconfig:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
eth0      Link encap:Ethernet  HWaddr 00:06:5B:55:26:F0
          inet addr:20.0.0.193  Bcast:20.0.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1597 errors:0 dropped:0 overruns:1 frame:0
          TX packets:1052 errors:0 dropped:0 overruns:0 carrier:0
          collisions:47 txqueuelen:100
          RX bytes:703409 (686.9 Kb)  TX bytes:99376 (97.0 Kb)
          Interrupt:18 Base address:0xdc80

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:90 errors:0 dropped:0 overruns:0 frame:0
          TX packets:90 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:8480 (8.2 Kb)  TX bytes:8480 (8.2 Kb)



9  Game Development / Networking & Multiplayer / Re: Linux-Server ignors my Clients! on: 2004-01-08 10:24:54
No - I modified the client so that it uses 8013 but still nothing...

However - I just tried to bind my server differently:

I replaced
1  
InetSocketAddress isa = new InetSocketAddress(InetAddress.getLocalHost(), port)


With
1  
InetSocketAddress isa = new InetSocketAddress(port)


and guess what... I got through to my server! The only question is why?
10  Game Development / Networking & Multiplayer / Re: Linux-Server ignors my Clients! on: 2004-01-08 09:52:55
Yepp... Tried to do it "locally" on the linux-server and that works fine.

I'm trying to make the TimeServer / TimeQuery to work and you can look at them here : http://java.sun.com/j2se/1.4.2/docs/guide/nio/example/index.html

I'm using the same approach frmo my own server and as long as I can't get the TimeServer to work, I'm lost...Sad

It's very straight forward so I really can't get why it doesn't work!

Selectors perhaps?
/Markus
11  Game Development / Networking & Multiplayer / Re: Linux-Server ignors my Clients! on: 2004-01-08 09:23:52
I just tested to run a simple EchoServer that used ServerSocket instead of ServerSocketChannel

Tada - It works! It's just that I would like to use channels (java.nio)!

So - Now I have a ServerSocket that works and a ServerSocketChannel that doesn't work!

Any ideas?
12  Game Development / Networking & Multiplayer / Re: Linux-Server ignors my Clients! on: 2004-01-08 08:30:44
Nope - No firewall - Standard installation of Mandrake with jdk 1.4.2.

Should work! (but doesn't...) Sad
/Markus
13  Game Development / Networking & Multiplayer / Linux-Server ignors my Clients! on: 2004-01-08 07:26:16
I've developed a Java server on Win XP and it works great, using the java.nio package.

However - When I put it to the test and ran it from my Linux (Mandrake / RedHat) server where it's suppose to run, the server just ignore my client. Nothing happens!

The client gets the follow exception:
1  
2  
3  
java.net.ConnectException: Connection refused: connect
      at sun.nio.ch.Net.connect(Native Method)
      at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:457)


I tried to use tutorial examples from sun's homepage (TimeQuery / TimeServer) and I get the same error : Works great on windows but not at all in Linux.

However, it works when I reverse the roles and let Linux be client and use Windows as Server.

Therefore I make the conclusion that Linux has to be modified in some way (security aspects?) so that it is allowed to listen, connect, accept new connections...
It obviousely works when Linux acts as a client, but not at all as server!

I tried to modify my java.policy file but I can't make it work!

Thanx for your help!
/Markus
14  Java Game APIs & Engines / Java 2D / Re: Prevent crashes when ending fullscreenmode? on: 2003-12-04 10:11:52
And another version of crashing when closing down my fullscreenmode:


An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : EXCEPTION_ACCESS_VIOLATION occurred at PC=0x0
Function=[Unknown.]
Library=(N/A)

NOTE: We are unable to locate the function name symbol for the error
     just occurred. Please refer to release documentation for possible
     reason and solutions.


Current Java thread:
     at sun.awt.windows.Win32BackBufferSurfaceData.initSurface(Native Method)
     at sun.awt.windows.Win32BackBufferSurfaceData.createData(Win32BackBufferSurfaceData.java:49)
     at sun.awt.windows.Win32BackBuffer.createHWData(Win32BackBuffer.java:28)
     at sun.awt.windows.WVolatileImage.initAcceleratedBackground(WVolatileImage.java:100)
     at sun.awt.windows.Win32BackBuffer.displayChanged(Win32BackBuffer.java:35)
     at sun.awt.SunDisplayChanger.notifyListeners(SunDisplayChanger.java:102)
     at sun.awt.Win32GraphicsEnvironment.displayChanged(Win32GraphicsEnvironment.java:98)
     at sun.awt.windows.WToolkit$4.run(WToolkit.java:723)
     at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
     at java.awt.EventQueue.dispatchEvent(EventQueue.java:448)
     at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:197)
     at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:144)
     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136)
     at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)
15  Java Game APIs & Engines / Java 2D / Prevent crashes when ending fullscreenmode? on: 2003-12-04 10:08:16
Hi!

It's been a while since I posted last, but here comes new problems that I need your help with;)

I run my 2D games in fullscreen mode and it works great, besides frmo the fact that it generates (sometimes!) a rather ugly .log crash file when I exit the game. This seems to be a common error and I've seen it in other peoples demos and stuff.

I've read around in this forum quit a lot and some say that "fullscreen can be a bit buggy" and that you "have to work around it" and I'm quit interested in HOW to do that Wink

Concluding:
How can I prevent my fullscreen, active rendering application (bufferstrategy) to end so badly when I exit?

Here's an output from a typical .log file
(hs_err_pid4068.log)

An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : EXCEPTION_ACCESS_VIOLATION occurred at PC=0x6D069916
Function=Java_sun_print_Win32PrintJob_printRawData+0x4F26
Library=C:\Program\JBuilder9\jdk1.4\jre\bin\awt.dll

Current Java thread:
     at sun.java2d.DefaultDisposerRecord.invokeNativeDispose(Native Method)
     at sun.java2d.DefaultDisposerRecord.dispose(DefaultDisposerRecord.java:24)
     at sun.java2d.Disposer.run(Disposer.java:99)
     at java.lang.Thread.run(Thread.java:536)

Dynamic libraries:
0x00400000 - 0x00407000       C:\Program\JBuilder9\jdk1.4\bin\javaw.exe
0x77F50000 - 0x77FF9000       C:\WINDOWS\System32\ntdll.dll
0x77E60000 - 0x77F4A000       C:\WINDOWS\system32\kernel32.dll
0x77DC0000 - 0x77E5D000       C:\WINDOWS\system32\ADVAPI32.dll
0x78000000 - 0x78086000       C:\WINDOWS\system32\RPCRT4.dll
0x77D30000 - 0x77DBC000       C:\WINDOWS\system32\USER32.dll
0x77C60000 - 0x77CA0000       C:\WINDOWS\system32\GDI32.dll
0x77C00000 - 0x77C53000       C:\WINDOWS\system32\MSVCRT.dll
0x6D340000 - 0x6D46A000       C:\Program\JBuilder9\jdk1.4\jre\bin\client\jvm.dll
0x76B30000 - 0x76B5D000       C:\WINDOWS\System32\WINMM.dll
0x5D270000 - 0x5D277000       C:\WINDOWS\System32\serwvdrv.dll
0x5B5A0000 - 0x5B5A7000       C:\WINDOWS\System32\umdmxfrm.dll
0x6D1E0000 - 0x6D1E7000       C:\Program\JBuilder9\jdk1.4\jre\bin\hpi.dll
0x6D310000 - 0x6D31E000       C:\Program\JBuilder9\jdk1.4\jre\bin\verify.dll
0x6D220000 - 0x6D239000       C:\Program\JBuilder9\jdk1.4\jre\bin\java.dll
0x6D330000 - 0x6D33D000       C:\Program\JBuilder9\jdk1.4\jre\bin\zip.dll
0x10000000 - 0x1001E000       E:\Projects\Kidwo\KidwoClient\TrayIcon12.dll
0x773C0000 - 0x77BB4000       C:\WINDOWS\system32\SHELL32.DLL
0x70A70000 - 0x70AD5000       C:\WINDOWS\system32\SHLWAPI.dll
0x78090000 - 0x78174000       C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.10.0_x-ww_f7fb5805\comctl32.dll
0x77330000 - 0x773BB000       C:\WINDOWS\system32\comctl32.dll
0x5B270000 - 0x5B2A4000       C:\WINDOWS\System32\uxtheme.dll
0x6D2E0000 - 0x6D2EE000       C:\Program\JBuilder9\jdk1.4\jre\bin\net.dll
0x71AC0000 - 0x71AC9000       C:\WINDOWS\System32\WSOCK32.dll
0x71AA0000 - 0x71AB4000       C:\WINDOWS\System32\WS2_32.dll
0x71A90000 - 0x71A98000       C:\WINDOWS\System32\WS2HELP.dll
0x746F0000 - 0x74734000       C:\WINDOWS\System32\MSCTF.dll
0x63000000 - 0x63014000       C:\WINDOWS\System32\SynTPFcs.dll
0x77BF0000 - 0x77BF7000       C:\WINDOWS\system32\VERSION.dll
0x71A40000 - 0x71A7C000       C:\WINDOWS\system32\mswsock.dll
0x0B390000 - 0x0B397000       C:\Program\Logitech\MouseWare\System\LgWndHk.dll
0x71A80000 - 0x71A88000       C:\WINDOWS\System32\wshtcpip.dll
0x6D000000 - 0x6D105000       C:\Program\JBuilder9\jdk1.4\jre\bin\awt.dll
0x72FD0000 - 0x72FF3000       C:\WINDOWS\System32\WINSPOOL.DRV
0x76370000 - 0x7638C000       C:\WINDOWS\System32\IMM32.dll
0x7CCC0000 - 0x7CDE1000       C:\WINDOWS\system32\ole32.dll
0x73730000 - 0x73774000       C:\WINDOWS\System32\ddraw.dll
0x73B90000 - 0x73B96000       C:\WINDOWS\System32\DCIMAN32.dll
0x73910000 - 0x739D7000       C:\WINDOWS\System32\D3DIM700.DLL
0x6D190000 - 0x6D1E0000       C:\Program\JBuilder9\jdk1.4\jre\bin\fontmanager.dll
0x0F5D0000 - 0x0F5D7000       C:\Program\Logitech\iTouch\iTchHk.dll
0x0F5F0000 - 0x0F5FB000       C:\Program\Delade filer\Logitech\Scrolling\LgMsgHk.dll
0x76060000 - 0x760C1000       C:\WINDOWS\System32\MSVCP60.dll
0x6D2B0000 - 0x6D2D1000       C:\Program\JBuilder9\jdk1.4\jre\bin\jsound.dll
0x72CF0000 - 0x72CF9000       C:\WINDOWS\System32\wdmaud.drv
0x72CE0000 - 0x72CE8000       C:\WINDOWS\System32\msacm32.drv
0x77BD0000 - 0x77BE4000       C:\WINDOWS\System32\MSACM32.dll
0x77BC0000 - 0x77BC7000       C:\WINDOWS\System32\midimap.dll
0x6D290000 - 0x6D2AE000       C:\Program\JBuilder9\jdk1.4\jre\bin\jpeg.dll
0x10420000 - 0x10436000       E:\Projects\Kidwo\KidwoClient\timer.dll
0x76C80000 - 0x76CA2000       C:\WINDOWS\system32\imagehlp.dll
0x6DAA0000 - 0x6DB1D000       C:\WINDOWS\system32\DBGHELP.dll
0x76BE0000 - 0x76BEB000       C:\WINDOWS\System32\PSAPI.DLL

Local Time = Thu Dec 04 14:07:12 2003
Elapsed Time = 19
#
# The exception above was detected in native code outside the VM
#
# Java VM: Java HotSpot(TM) Client VM (1.4.1_02-b06 mixed mode)
#




16  Java Game APIs & Engines / Java 2D / Re: 2D Collision detection / reaction on: 2003-10-22 03:38:05
Yes, I do a bounds-test before going into the polygon cmp algorithm Wink I was in a hurry when I wrote the post - My bad...

I feel a bit doubtsome to the "if contact, then don't"-sollution since that isn't as "general" as I want it to be. What if I jump towards a wall? Then I should stop moving horizontally, but still add gravity to make the caracter fall down... In my engine, the gravity is custom to the game you implement, thus you can have horizontal gravity in both directions AND/OR vertical gravity...

I don't want to think about the number of "special cases" that I would have to define in order to make it work Wink And if I made it work, I'd probably find a case that I didn't cover sooner or later...

The only real general sollution must (should?) somehow involve the normals of the surfaces that I detect collision with... I just don't see how at the moment  :-/

Perhaps I could try to combine the "if contact, then don't" concept and just ignore all incrementations of the object's velocity that has a composant in the same direction as the collisoni sureface... that would allow forces to work on the objects without further trying to go "into" the surface that I've detected collision with...?

In need of more input Wink
/Markus
17  Java Game APIs & Engines / Java 2D / 2D Collision detection / reaction on: 2003-10-21 11:34:37
So,

I'm implementing collision detection to my 2D game engine and I have some problems as of how to get going.

All my game objects are polygons that I've tweeked / implemented myself so the speed is not any problems. However, I wonder how I should detect the collisions...

At the moment I cmp polygon segments with each other i a nice (?) N2 mannor and generate a list of normals that I've intersected. The next step is the tricky part though since I don't know how to react.

I mean, imagine a box approaching a different box horizontally until you detect collision. The collision I've detected only contain two normals - the top / bottom surfaces of the testpolygon.

I've tried to simply calculate the penetration depth of the collision and seperate the objects from each other according the velocity of the gameobject that collided, but there's a major bug to that:

What if my gameobject is a person walking on a ground polygon and the person is affected by gravity - Then I detect collisions constantly (to keep the person from falloing though the floor) and when the person tries to move in any direction, he's more or less stuck!

I feel that I have to calculate scalar-products with the normals of the surfaces that I've collided with, but then I have to calculate differently since I havn't detected the surface directed towards the approaching box in the above example... Gaah! Wink

This is where I hope that you guys come in and make my day a little brighter - Thanx!
/Markus
18  Game Development / Newbie & Debugging Questions / Re: Automatic Applet focus? on: 2003-10-20 04:54:17
Yepp...

You're probably right - Click to start is the only "neat" solution to the prob.

But it would be fun to be able to do it, but I recall reading something similiar to what you describe, oNyx.

Thanx / Markus
19  Game Development / Performance Tuning / Re: Timer alternatives in Applets? on: 2003-10-17 12:00:31
I get the picture. I was just unsure of how currentTimeMillis was implemented...

BTW - Yes, MGodehardt I also recall the double frequency stuff from when I graduated a M.Sc in Computer Engineering, Mechatronical Systems and currently work / teach as a Ph.D student in sweden...

Some people study at university but still don't know everything about Java...

You learn as long as you live, otherwise it would be kind'a boring Wink

/Markus
20  Game Development / Networking & Multiplayer / Re: AUtomatic focus to Applets when loaded on: 2003-10-16 10:17:24
Understood and appruchiated Wink I realize what online gaming is all about but when you start to get that deperate feeling and nothing works... you have to post somewhere and online was the closest thing to applets as I could find.

Sorry if I mess things up for you :-/

/Markus
21  Game Development / Networking & Multiplayer / Re: AUtomatic focus to Applets when loaded on: 2003-10-16 09:23:40
Well... I don't meen to be rude, but I thought that "online game development" should be just that - development of online games and Applets sort of define the term "online"...

Therefore I thought that this was a good place to ask but maybe I was wrong...
22  Game Development / Newbie & Debugging Questions / Automatic Applet focus? on: 2003-10-16 08:58:38
Does anyone know how I could make my applet gain focus automatically when it has loaded.

The current version of my project requires the user to click on the applet once, before the keys that control the game gets through...  

I really hope that this is a problem that can be solved...  

I've tried the requestFocus() method and the javascript approach but they don't do the trick!

/Markus
23  Game Development / Performance Tuning / Re: OutOfMemoryExceptions - Gotta free memory! on: 2003-10-16 06:27:46
... and I'm supposed to have an engineering degree...  Embarrassed

Kind 'a forgot that an int consists of 4 bytes... Opps.

Thanx for not throwing that at me as hard as I deserved Wink
24  Java Game APIs & Engines / Java 2D / Re: Flickering scrolling backgrounds on: 2003-10-16 06:23:28
Sorry - Big typo...  Embarrassed

I mean (natuarlly) setIgnoreRepaint(true)
25  Java Game APIs & Engines / Java 2D / Re: Flickering scrolling backgrounds on: 2003-10-16 03:04:08
Ok... I'm using window mode BufferStrategy with 2 (or 4 - doesn't matter) buffers an a Canvas. I've set the ignoreRepaint false on the canvas but still get a flickering feeling. The faster I scroll, the more flicker I get ( combined with the impact of the size of the image).

I load the images as managed images and not Volatile. AFAIK VolatileImages magic is the ability to have a accelerated Graphics objc connected to it, hence it should be used for your own backbuffers so that one can render managed images on it? Correct me if I'm wrong Wink
26  Game Development / Performance Tuning / Re: OutOfMemoryExceptions - Gotta free memory! on: 2003-10-16 02:50:06
Alright... I'm starting to get the hang of how it should be done.

I wonder this though:

Tom said:
Quote

Thats 32MB


as a response to my 3200x2500 px bg image and I'd really like to now HOW it becomes that big... In my world (of illusions?) I'd like to calculate an image size as the nbr of px width times height and that would give me 3200 * 2500 = 8750000 = 8.75MB? This based on my assuming that the images are stored as int []?

Obviously, tom is correct since my JProfiler tells me that I've got 30MB+ stored in int [] but I really don't understand why / how? How are images represented in Java?
27  Game Development / Performance Tuning / Re: OutOfMemoryExceptions - Gotta free memory! on: 2003-10-15 12:55:10
Big thanx to all of you! You're fast and informative replies are the reason for why I've come to love this forum Cheesy

When thinking of it, I know that I have references laying around which prevents the gc from collecting... The problem of how ( in a general manner) to deal with this is another issue that I'll try to master tomorrow Wink

Anyway - Interesting thoughts came to my head:
The background image is quite big - 3200x2500 px and is used as a scrolling background for my Zelda-look-alike game that happens to be an Applet which brings me to my next question:

How can I apply all the switches that you're refering to in your replies when I don't develope appz?  I assume that the switches can be applied to "appletviewer"?

BTW - I ran JProfiler on my game and looked at the heap usage -- Is it normal to have a triangular wave of mem.usage? Ideally, I'd like a constant line (after initialization is completed) but I don't...

Curious!

/Markus
28  Game Development / Performance Tuning / OutOfMemoryExceptions - Gotta free memory! on: 2003-10-15 09:42:47
I've built a 2D-gameengine for classical games such as SuperMario or similar where you can define several "levels" as different GameSlides where each gameslide has neighbouring gameslides and so on.

The same concept as when playing Diablo I / II and you walk out from the village and you have to "load the next level".

Which brings me to the question:

This loading between gameslides works well enough for smaller games, but I just made my own Zelda-style game with quite big background images and suddenly I get a OutOFMemoryException (due to the big background I suppose) :/ Therefor I have to deallocate the allready loaded stuff when I change slide and THAT's the question...

I chech the available memory using Runtime freeMemory() / availableMEmory() / totalMemory() and nomatter what I try, it just won't deallocate and free the previous slides...

How do I manually remove stuff from the heap?
(much text for a trivial question, but I hope you get my point)

/Markus
29  Game Development / Networking & Multiplayer / Re: AUtomatic focus to Applets when loaded on: 2003-10-15 09:35:14
I havn't tried it myself, but I've read about other people that tried the javascript approach without success... Sad
30  Game Development / Networking & Multiplayer / Re: AUtomatic focus to Applets when loaded on: 2003-10-15 08:28:36
Tried that... don't work...
I tried it both as:

applet.requestFocus();

and

aniamtionCanvas.requestFocus();

and I still have to click inside the applet to gain focus...

Hmmm...! Any other suggestions?
/Markus
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.

theagentd (18 views)
2014-10-25 15:46:29

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

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

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

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

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

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

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

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

BurntPizza (45 views)
2014-10-11 23:10:45
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!