Author Topic: Need example with jpct and project darkside.  (Read 5341 times)

Offline zammbi

  • float
  • ****
  • Posts: 360
    • View Profile
Need example with jpct and project darkside.
« on: August 20, 2008, 06:59:02 am »
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.

Offline Melssj5

  • double
  • *****
  • Posts: 715
    • View Profile
Re: Need example with jpct and project darkside.
« Reply #1 on: August 20, 2008, 03:49:42 pm »
What is darkside?
Nada por ahora

Offline zammbi

  • float
  • ****
  • Posts: 360
    • View Profile
Re: Need example with jpct and project darkside.
« Reply #2 on: August 20, 2008, 04:08:51 pm »
Basically a server engine.
This link should tell you all the info you need:
http://www.projectdarkstar.com/

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11744
    • View Profile
    • http://www.jpct.net
Re: Need example with jpct and project darkside.
« Reply #3 on: August 21, 2008, 11:58:01 am »
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?

Offline zammbi

  • float
  • ****
  • Posts: 360
    • View Profile
Re: Need example with jpct and project darkside.
« Reply #4 on: August 21, 2008, 12:11:10 pm »
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.

Offline Jonas

  • byte
  • *
  • Posts: 41
    • View Profile
Re: Need example with jpct and project darkside.
« Reply #5 on: August 21, 2008, 12:37:01 pm »
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

Offline zammbi

  • float
  • ****
  • Posts: 360
    • View Profile
Re: Need example with jpct and project darkside.
« Reply #6 on: August 21, 2008, 12:44:11 pm »
I would need to do both I guess. Since collisions would need to be calculated on the server side to stop cheating.

Offline Jonas

  • byte
  • *
  • Posts: 41
    • View Profile
Re: Need example with jpct and project darkside.
« Reply #7 on: August 23, 2008, 06:51:05 pm »
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

Offline zammbi

  • float
  • ****
  • Posts: 360
    • View Profile
Re: Need example with jpct and project darkside.
« Reply #8 on: August 24, 2008, 07:07:33 am »
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.

Offline zammbi

  • float
  • ****
  • Posts: 360
    • View Profile
Re: Need example with jpct and project darkside.
« Reply #9 on: August 26, 2008, 06:46:43 pm »
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?

Offline zammbi

  • float
  • ****
  • Posts: 360
    • View Profile
Re: Need example with jpct and project darkside.
« Reply #10 on: September 01, 2008, 08:51:24 am »
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?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11744
    • View Profile
    • http://www.jpct.net
Re: Need example with jpct and project darkside.
« Reply #11 on: September 01, 2008, 08:55:30 am »
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.
« Last Edit: September 01, 2008, 09:56:02 am by EgonOlsen »

Offline zammbi

  • float
  • ****
  • Posts: 360
    • View Profile
Re: Need example with jpct and project darkside.
« Reply #12 on: September 01, 2008, 09:18:35 am »
Ah thanks, probable something I shouldn't worry about atm then.