[OpenLayers-Dev] Game development problem - speed with lot of objects

Abuki abuki at argo.in
Fri Jan 9 08:59:55 EST 2009


Hello,
I´m gonna explain the hole problem.

I want to do some browser-game using openlayers, similar to the-west.net
game. I have already seen just one (warwide.com) using openlayers (but they
are using markers).
Game map should contain some objects as houses, rocks, players etc. Some of
them are active (clickable) and some of them are just images (eg rocks).

I want to have these all objectives in mysql database and somehow load it
from it.
If understand it well, then for each of active object I need:
1) Image layer or something like layer that display raster images
2) Vector layer that defines clickable area of that object (because it is
not always the same)
>From above should be clear, that I dont want to use markers, because
a) they are represented by icon, which is whole clikable or not
b) they dont resize on zoom, so eg the rock on zoomout/in wil be the same
size as before

I know, that I´m maybe little slow with thinking about that all, becaouse I
dont understand some yours explanations.
1) Is there any possibility to load these objectives from mysql with php and
put them into map with no slow loading (and them browse the map smoothly)?
Or is the only possibility to do that with some mapserver?
2) If the only possibility of speed this up is to make it with mapserver -
then I really dont understand how to do it. I must install some aplication
or service on the server? Because if my web pages are hosted on some server,
then I cant do something like that.. 

My code is now on  http://game.argo.in/game.php http://game.argo.in/game.php
.
As you can see from source code, all objectives are loaded from mysql by php
into javascript.
Loading and browsing is slow. You see also that there are layers with images
and layer with clickable polygons. I know my code is not ideal, so I want
somehow to improve it to have as quick as possible..

Thanks for any advice..
Abuki


Jachym Cepicky wrote:
> 
> Hi,
> as mentioned earlier, OpenLayers.Layer.Markers should work for you
> better (see http://openlayers.org/dev/examples/markers.html for
> example).
> 
> If you decide to try custom mapserver layer, maybe you could have a
> look at GeoServer [1] as well. It's configuration is GUI-based (in
> contradistinction to MapServer [2]).
> 
> And to make it even more complicated, maybe storing the data into
> PostGIS[3] database could simplify (at the end) some things as well.
> 
> Jachym
> 
> [1] http://geoserver.org
> [2] http://mapserver.gis.umn.edu
> [3] http://postgis.org
> 
> 2009/1/8 Abuki <abuki at argo.in>:
>>
>> Hello,
>> I´m not expert on OpenLayers and also English (I´m from Czech).
>> I´m just trying to make my own browser-based game and I want to use
>> OpenLayers for world map.
>> Now the problem:
>> I want to put on the base layer some object (coordinates from mysql)
>> represented by png images (eg house) and I do it like this: make polygons
>> (circles), make features and make featureLayer (I dont want use markers,
>> because I would like have the clickable area not always square). Then add
>> control onmouseclick, so i have clickable object - thats ok. But I dont
>> know
>> how to put there a lot of images, the only way I understand is to make
>> image
>> layer for every single PNG image, its ok BUT: When I put in mysql 1000
>> objects a make this for all of them, it is slow (it takes about 10sec
>> loading and browsing is not smooth), and i´m afraid that this is simple
>> so
>> what if would come something complicated...
>> I dont uderstand mapservers and i want to find the way to not use them,
>> because i will run the game on hosted site, so I cant install it there.
>> Also
>> when I try only vector or images layer alone it was slow.
>> So could anyone help me to get it work faster? And is it possible without
>> mapserver?
>> Thanks
>> Abuki
>>
>> --
>> View this message in context:
>> http://n2.nabble.com/Game-development-problem---speed-with-lot-of-objects-tp2129189p2129189.html
>> Sent from the OpenLayers Dev mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> Dev mailing list
>> Dev at openlayers.org
>> http://openlayers.org/mailman/listinfo/dev
>>
> 
> 
> 
> -- 
> Jachym Cepicky
> e-mail: jachym.cepicky gmail com
> URL: http://les-ejk.cz
> GPG: http://les-ejk.cz/pgp/JachymCepicky.pgp
> _______________________________________________
> Dev mailing list
> Dev at openlayers.org
> http://openlayers.org/mailman/listinfo/dev
> 
> 

-- 
View this message in context: http://n2.nabble.com/Game-development-problem---speed-with-lot-of-objects-tp2129189p2133253.html
Sent from the OpenLayers Dev mailing list archive at Nabble.com.




More information about the Dev mailing list