Author Topic: Technopolies  (Read 288712 times)

Offline Uija

  • int
  • **
  • Posts: 52
    • View Profile
Technopolies
« Reply #120 on: July 25, 2005, 04:53:56 pm »
I see. Your client starts to walk, so you start the animation and the movement and send the data to the server. now the server calculates the informations and sends correct values to the client. as the client should have the same date (if not, bug or cheat) he corrects it?
That was, what I was planning. The only problem that fills my mind regarding this is the problem of holding the map on the server. are you using a 3d client for each zone/map or do you calculate on base of an array or something yourself?

Offline manumoi

  • long
  • ***
  • Posts: 121
    • View Profile
    • http://www.iro.umontreal.ca/~blanchae
Technopolies
« Reply #121 on: July 25, 2005, 11:19:19 pm »
i think i fixed my ConcurrentModificationException . I was trying to modify a collection (a Hashmap) while i was iterating it and of course it is not allowed... Maybe your error is similar.

Offline rolz

  • float
  • ****
  • Posts: 280
  • Technocrat
    • View Profile
Technopolies
« Reply #122 on: July 26, 2005, 08:28:24 am »
currently, technopolies stores relief and texture maps for locations as images on client in a jar file. I do not think it would take much to load maps from server (less than 3k for each image)
Regards,
Andrei

Offline Uija

  • int
  • **
  • Posts: 52
    • View Profile
Technopolies
« Reply #123 on: July 26, 2005, 08:50:57 am »
I think you missunderstood me.
You said, you are calculating collision stuff on the server. My question was: Is your server calculation this based on an 3d Engine or are you calculatin this by yourself, based on some Mapdata in an Array or something?

Offline rolz

  • float
  • ****
  • Posts: 280
  • Technocrat
    • View Profile
Technopolies
« Reply #124 on: July 26, 2005, 10:34:58 am »
You may have to check previous posts in this topic to see what Technopolies server looks like.  

The map is 2d on server, looking at minimap (in the upper right corner) should give you the picture about what is hapening on server.
Regards,
Andrei

Offline Uija

  • int
  • **
  • Posts: 52
    • View Profile
Technopolies
« Reply #125 on: July 26, 2005, 10:51:47 am »
Oh, yeah I remember the images. So you really work with a graphical engine on the server.

Offline rolz

  • float
  • ****
  • Posts: 280
  • Technocrat
    • View Profile
Technopolies
« Reply #126 on: July 26, 2005, 12:31:30 pm »
a kind of, server manipulates with 2d shapes.
It is quite fast, on a p4-3g 100 zones 1000x1000 meters each (200 moving objects, 200 static objects) takes ~0.7sec. to calculate movements / collistions.
Regards,
Andrei

Offline rolz

  • float
  • ****
  • Posts: 280
  • Technocrat
    • View Profile
updated client
« Reply #127 on: July 26, 2005, 02:29:03 pm »
updated client

 - fixed concurrentModification exception
 - fixed bug when event listeners were not cleared after moving to another location, causing to receive events from invisible players
Regards,
Andrei

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: updated client
« Reply #128 on: July 26, 2005, 04:59:33 pm »
Quote from: "rolz"
- fixed concurrentModification exception
Are you sure? I've downloaded the new client, but i'm still getting the same exception:
Code: [Select]
Exception in thread "AWT-EventQueue-0" java.util.ConcurrentModificationException
at java.util.AbstractList$Itr.checkForComodification(Unknown Source)
at java.util.AbstractList$Itr.next(Unknown Source)
at aD.a(Unknown Source)
at aD.paint(Unknown Source)
at java.awt.GraphicsCallback$PaintCallback.run(Unknown Source)
at sun.awt.SunGraphicsCallback.runOneComponent(Unknown Source)
at sun.awt.SunGraphicsCallback.runComponents(Unknown Source)
at java.awt.Container.paint(Unknown Source)
at y.paint(Unknown Source)
at y.update(Unknown Source)
at sun.awt.RepaintArea.updateComponent(Unknown Source)
at sun.awt.RepaintArea.paint(Unknown Source)
at sun.awt.windows.WComponentPeer.handleEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)


The client.jar is dated 2005-07-25 11:17. Is that the most current one?

Offline rolz

  • float
  • ****
  • Posts: 280
  • Technocrat
    • View Profile
Technopolies
« Reply #129 on: July 26, 2005, 05:05:43 pm »
AAAAAAAAAAAAAARGGGGGGGH!!!!!!!!!!!!!!!!!1
Regards,
Andrei

Offline manumoi

  • long
  • ***
  • Posts: 121
    • View Profile
    • http://www.iro.umontreal.ca/~blanchae
Technopolies
« Reply #130 on: July 26, 2005, 08:56:02 pm »
Rolz, did you look at ConcurrentModificationException page in the JDK javadoc? there is a small discussion concerning when it can occur. As i said before my own problem was that i was modifying a collection (removing elements) while there was an iterator working on the same collection. I resolved it by not directly removing the element but putting its key (the collection is an hashmap) in a vector and deleting every elements referring to keys that are in my vector after the end of the iterator work (hope i m clear  :? )...

Offline manumoi

  • long
  • ***
  • Posts: 121
    • View Profile
    • http://www.iro.umontreal.ca/~blanchae
Technopolies
« Reply #131 on: July 26, 2005, 09:08:48 pm »
Is there a specific reason you choosed to do all your processing on your server? My own approach is to separate processing. Each clients will do collision detection... etc and send periodically its new position to the server... The server will maintain a collection of object position and it will send that collection to clients... It is more or less oriented on a grid topology:  each node/client participates to the processing...I think if the number of clients grow, the performance should not differ that much. So is there something that made you choose to centralize your processing?

Offline rolz

  • float
  • ****
  • Posts: 280
  • Technocrat
    • View Profile
Technopolies
« Reply #132 on: July 27, 2005, 04:20:50 pm »
your idea sounds interesting. How are you going to resolve interactions that involve 2+ players (movements, picking items, attacking)?

I thought of something like this but finaly came to conclusion that i should care about simple comprehensive model first ;)

Really, at first technopolies should have been very extensible/scalable/whatsoever, but i stuck in the middle because of the overhead of the complexity that was caused by all these "thoughts ahead of time". And finally i had to roll back and start anew relying on a simple model. BTW that is why i hate IOC and its followers ;)

If it is ever doable to to eat an elephant - then only by small pieces
Regards,
Andrei

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Technopolies
« Reply #133 on: July 27, 2005, 05:44:12 pm »
Quote from: "manumoi"
Is there a specific reason you choosed to do all your processing on your server? My own approach is to separate processing. Each clients will do collision detection... etc and send periodically its new position to the server... The server will maintain a collection of object position and it will send that collection to clients... It is more or less oriented on a grid topology:  each node/client participates to the processing...I think if the number of clients grow, the performance should not differ that much. So is there something that made you choose to centralize your processing?
Depending on how you are implementing the collision detection, this may cause trouble IMO. Imagine entity A on client a move towards entity B (standing still on a) and entity B on client b moves towards A (standing still on b). Locally, this is no problem. On a, you correct the movement of A to not run into B and on b, you correct B's movement to not run into A. a and b are then sending the result back to the server. But then, A and B may cover the same space.
Have a look:

Offline rolz

  • float
  • ****
  • Posts: 280
  • Technocrat
    • View Profile
Technopolies
« Reply #134 on: July 27, 2005, 05:53:40 pm »
Exactly, it is simplier to have calculations centralized.

Regarding technopolies, the server is a forever loop that executes player orders and sends resulting events to event listeners. Clients do not modify anything directly, they place orders from player to a command queue on server.
Regards,
Andrei