www.jpct.net

jPCT - a 3d engine for Java => Projects => Topic started by: acorn98 on January 20, 2004, 03:52:54 pm

Title: tokima
Post by: acorn98 on January 20, 2004, 03:52:54 pm
www.tokima.com uses the jPCT API. It's up and in beta - enjoy.
Title: tokima
Post by: EgonOlsen on January 20, 2004, 06:46:29 pm
Looks great and proves that simple vertex-lighting can still produce very nice results. However, i noticed two issues while running around in the level: There's some Z-fighting when polygons overlap. But that's a "problem" with the model, not with the code. It's not that bad anyway.
I assume it's somehow based on the fps-demo? If so, on which version? Older versions did the actual movement in the timer-thread and with the upgrade to a P4 with Hyperthreading, i noticed that this isn't a good idea, because it leads to threading issues (like when the timer-thread is working on a rotation-matrix the main-thread uses for rendering). This results in parts of the geometry rendered wrong or distorted for a frame. And this is exactly what i noticed when running around in the level. Note that i never experienced this on none-HT CPUs like Athlons, so it's difficult to explain and debug. Have a look at the newer version of the fps-demo to see how i'm doing it now. As a rule of thumb: Never let any other thread than the main-thread (the thread that does the rendering) modify the camera or some object's matrices. Not the timer-thread and not an Event-Listener-thread (like a Key- or Mouse-Listener) because you may run into trouble. And it's a real pain to debug this stuff...believe me... :wink:
But now back to running around in this world... :D
Title: tokima
Post by: acorn98 on January 20, 2004, 07:01:35 pm
Thanks for the feedback - very handy. There's some bad poly overlap in places, mainly due to my abilities with 3dsMAX - I'm still getting to grips with it. My next effort should be considerably cleaner.

Yes, it's an fps adaptation - I can't remember which version exactly, but I think it was from around mid December. I don't have the source with me but I suspect I may have modded the camera in a mouse listener, and there are probably a variety of other coding misdemeanours! I'll revisit the code and improve it.

My next step is to get networking in there for multiplayer. I've got some old code somewhere which should do the trick, and it'll make the thing much more interesting.

...by the way - that fps source was fantastic. I'll fix the site up and add a proper credit to JPCT.net  :wink:
Title: tokima
Post by: EgonOlsen on January 20, 2004, 07:11:13 pm
Quote from: "acorn98"
There's some bad poly overlap in places, mainly due to my abilities with 3dsMAX - I'm still getting to grips with it. My next effort should be considerably cleaner.
.......by the way - that fps source was fantastic.
Yes...i noticed that there seems to be one (or some) large polygon below the street's actual polygons which "shines through" due to inaccuracies in the zBuffer (caused by the nature of it...nothing i can do about it). That's causing most of the z-fighting problems and it hurts fillrate and the octree. You should try to get rid of it IMHO.
The newer versions of the fps-code are even better... :wink: (No multi-threading issues anymore).
Keep up the good work. I really like the mood of this level.
Title: tokima
Post by: acorn98 on January 20, 2004, 09:47:06 pm
There were a couple of places where I had some gaps between street objects that I couldn't fix easily, and I found that the sky background was bleeding through. To patch it, I threw in a big plane under the street to block it off - I'll see about patching it properly.

Also, I have a couple of very long fences with a tiny repeating texture which seems to warp into a diagonal line - I think it started happening when I stretched the object to its current length (which is pretty big). Is it a bug, do you think?

I'll grab your latest fps source and have a look through, and remodel mine accordingly. I sometimes get the odd frame which flashes, which I
figured was down to the threads getting in a bit of a mess.

I wanted to make something quite dark and oppressive - I'll keep adding to it (work permitting) and see what develops.

Thanks for the tips!

[/quote]
Title: tokima
Post by: EgonOlsen on January 20, 2004, 10:11:29 pm
Quote from: "acorn98"
Also, I have a couple of very long fences with a tiny repeating texture which seems to warp into a diagonal line - I think it started happening when I stretched the object to its current length (which is pretty big). Is it a bug, do you think?


Are you talking about this? :

(http://www.jpct.net/pics/texturebug.jpg)

(i applied some "Gamma" to it...)

I'm not sure what that is exactly...could it be that the u/v-coordinates are very high here? Like (1000,1000) / (1000,1001) / (1001,1001) for such a triangle instead of (0,0) / (0,1) / (1,1)? That's the only idea i have ATM, because it can result in an overflow somehow. The renderer uses fixed point math for the coordinates but even 32bits are not enough sometimes. I think the highest value possible should be around (+-)256 or (+-)512...i not quite sure ATM. Could that be a problem here?
Title: tokima
Post by: acorn98 on January 21, 2004, 01:07:24 am
that's it!  I suspected it might be an overflow or somesuch.

It's not a huge problem because I can work around it. The original fences were about 1/3 the length, and they looked fine, so I can tweak the model to make it go away.
Title: tokima
Post by: raft on February 17, 2005, 03:53:45 am
Quote from: "EgonOlsen"
As a rule of thumb: Never let any other thread than the main-thread (the thread that does the rendering) modify the camera or some object's matrices. Not the timer-thread and not an Event-Listener-thread (like a Key- or Mouse-Listener) because you may run into trouble. And it's a real pain to debug this stuff...believe me... :wink:


it is quite true that debugging a multi-threaded application is a real pain. however using timers greatly eases some tasks.

you may consider using javax.swing.Timer instead of java.util.Timer since the former is executed in awt's event dispatching thread. assuming your rendering is done in paint or paintComponent methods you end up with a thread-safe timer mechanism.

Quote
r a f t
Title: tokima
Post by: acorn98 on November 03, 2005, 05:45:25 am
There's a new tokima demo here:

http://www.tokima.com/2005/default.html
Title: tokima
Post by: Raven on November 03, 2005, 02:54:19 pm
Wow. Looks awesome -- great design work there! And great effects when opening the xxxx (don't want to give anything away).  :wink:

The blitted text is good too, however, I would suggest that the "operate" button doesn't move the camera. I also found it a bit hard to know wether I was clicking the right place or wether there really was nothing to click on.

I just wish it was longer! It was really fun and spooky. Reminds me of one of my favorite old games: "Deja-vu".

More!

-Raven
Title: tokima
Post by: acorn98 on November 03, 2005, 05:13:17 pm
Thanks for the feedback Raven. I've hired some graphics/modelling/audio talent to turn this into a proper full-length game.

I'll have a think about ways to improve the clues that something is happening when you click stuff :)
Title: tokima
Post by: EgonOlsen on November 04, 2005, 01:05:44 am
Quote from: "acorn98"
I'll have a think about ways to improve the clues that something is happening when you click stuff :)
I think that the cursor should change somehow if you can interact with an item (get a green glow around it or something).
Great artwork and a cool mood (as usual!). About gameplay: I've found the card and opened the suitcase. Am i supposed to do anything else?
A technical question: Are you using any of jPCT's optimizations for indoor scenes (like Config.isIndoor and Config.zTrick)?

Edit: Oh, and i would appreciate if movement were a little faster. Maybe a 30-50% speedup.
Title: tokima
Post by: acorn98 on November 04, 2005, 01:51:25 am
A changed cursor is a good idea - much less frustrating!

Unfortunately, there's nothing more to do after the briefcase is open in the posted version, which is little more than a sandbox right now.

Regarding optimisation.. As you rightly point out, it's way too slow at present, and it will be optimised soon. I'm not too worried though - I think it'll be quite easy to do. The thing that really hurt the speed was when I stopped merging objects into one mega-object (I ran into problems with object picking) so I'll go back to merging the walls/floor. Also, my isIndoor=false, my farPlane is huge, so there's plenty of stuff for me to tweak  :)

Right now, the modeller is busy building new scenes, and trial audio loops and clips are being prepared. Once we have enough scenes we'll storyboard it properly and see what happens.

I thought that scripting a good story would be easy.. it's hard!  :lol:
Title: tokima
Post by: acorn98 on November 04, 2005, 11:12:56 pm
I have added a bunch of optimisations for speed and improved lighting  here:

http://www.tokima.com/2005a/

I've removed the map from the JAR for testing purposes, so loading time takes a while longer.
Title: tokima
Post by: Raven on November 06, 2005, 11:31:31 pm
Actually.. It doesn't seem to finish loading here on my end.
5 bars left of loading it just stops.

 :(

-Hrafn "Raven"
Title: tokima
Post by: acorn98 on November 12, 2005, 04:14:16 am
i have been away for a week, hence late reply.

does the java console show any errors?
Title: tokima
Post by: acorn98 on November 13, 2005, 07:22:23 am
There's a new applet here:

http://www.tokima.com/2005b
Title: tokima
Post by: Raven on November 13, 2005, 08:49:44 pm
Hey again.

Actually, my earlier post on Tokima not loading is no longer valid. I just tried it again and it works perfectly. Did you change something? Because I tried it a few times before and it didn't work.

The new demo looks (and sounds!) cool. It'd look better if you'd put some sort of grass texture on the ground and trees, it's kind of plastic-y as it is.

Regarding gameplay.... am I supposed to be able to escape from that little corner I start in? That mini-wall is driving me nuts, I can't get past it.  :oops:

Look forward to seeing more.
Title: tokima
Post by: acorn98 on November 13, 2005, 10:48:12 pm
Quote from: "Raven"
Did you change something? Because I tried it a few times before and it didn't work.


I was doing all kinds of changes, so that's probably what happened - I'm glad it's working again.

Quote from: "Raven"
Regarding gameplay.... am I supposed to be able to escape from that little corner I start in?


No, there's nothing to do - this is just a test applet. I put it together last night as an experiment.

I'm really just killing time while the game is in development. The modeller is busy creating levels and scenes at the moment.

As an aside, it is possible to escape the corner - use C and V (crouch and stand) whilst moving forward to do a sort of 'jump'  :wink:
Title: tokima
Post by: EgonOlsen on November 14, 2005, 10:26:15 pm
The best thing is: The birds continue singing after quiting the browser window with the applet... :lol:
Title: tokima
Post by: acorn98 on November 14, 2005, 10:43:40 pm
heh heh..  oooops!!  :oops:

it must be feature  :wink: Better fix it quick..
Title: tokima
Post by: Anonymous on November 17, 2005, 12:26:43 am
screenshots:

(http://www.maximumammo.com/test.jpg)

http://www.tokima.com/2005c