Need example with jpct and project darkside.

Started by zammbi, August 20, 2008, 06:59:02 AM

Previous topic - Next topic

zammbi

Hey I been learning project darkside for a little while, I wanted to know if anyone has examples using it with jpct?
It would help a lot if someone could post an example using both for a basic server. So I know how to set it up right.

Melssj5

Nada por ahora

zammbi

Basically a server engine.
This link should tell you all the info you need:
http://www.projectdarkstar.com/

EgonOlsen

I've never used it and i don't know anybody who has. It's overkill for most projects IMHO. What are you planning to do with it?

zammbi

Ah ok, well I could try see if anyone has used jpct on there forum.
I want to use it for a online game I'm creating as it looks like it would cut my development time a lot.
It's a event based system which I'm not used too and not sure how integrate jpct into it right.

Jonas

Hi

Do you plan to use jpct client-side or server-side?
If youre using jpct just client-side there won't(and shouldn't) be too much integration between Darkstar and jpct.

A very simple approach would be to have darkstar put received messages into a queue
and then have them processed by another thread responsible for game state update and maybe rendering.


Simple things should be simple, complex things should be possible - Alan Kay

zammbi

I would need to do both I guess. Since collisions would need to be calculated on the server side to stop cheating.

Jonas

Well I guess it pretty much depends on what kind of project your shooting for, especially when it comes to
game state broadcasting.

The way I'm going to approach it is something like:

1.) Have a ManagedObject which represents/wraps a jpct-World object(arena, battlefield, dungeon..whatever).
2.) Add a ScheduledTask to that ManagedObject which broadcasts gamestate using a channel(if its turn based/slow just use normal messaging)
3.) Add a ScheduledTask per server controlled object doing things like AI/physics..
4.) Players can join these areas. Every player that joins gets added to the channel to receive gamestate
5.) Per player use a ScheduledTask to poll user input from time to time(using a queue or somesuch)
6.) Per player use another ScheduledTask to do things like physics

I'm currently having a look at sgs too, I just didn't have the time to actually implement jpct serverside yet. So this is pretty much best guess:). In a week or two i'll have a go at it I hope.
I'm pretty sure integrating jpct should be pretty easy, though. I'm a little bit more concerned about the protocol(game state etc) ;D.
Simple things should be simple, complex things should be possible - Alan Kay

zammbi

Thanks, well I'm going to give it a try and mess around and see what I can come up with.
I had tried looking at some of the advance examples using JME with darkside but that went over my head a little.

zammbi

Well this is so far going good. I've coded up the basics(able to do basic chat and what not) and have Jpct integrated though currently doesn't do much other then load a map.

Just just a basic question though not so important atm, what settings should I use in Jpct to be optimised for being used just for collisions? just default?

zammbi

Just checking on something, do need a world object on the server?
Since I only need to check for map collisions I can test that directly on the object. Is this the best way to do things?

EgonOlsen

#11
Try it. For checking collisions between objects, you need a world. For doing it on an object only, you may not need one. However, World is pretty light weight, so even if you need one, it doesn't consume much memory.

zammbi

Ah thanks, probable something I shouldn't worry about atm then.