Maps [for the lack of a better word]

For developmental things relating to the graphics of the game.
User avatar
philippeqc
Long Poster - Project Developer - Sage
Posts: 1526
Joined: Mon Jul 12, 2004 8:55 am
Location: Stockholm
Contact:

Post by philippeqc »

Tank Program wrote:
klax wrote:We could set one variable in the server named ARENA_SHAPE being an integer (could we set a variable being a string?).
Yes, it can be a string. I just don't know how to make the client load the same arena, or if it gets automatically transported across the network code somehow... I guess we'll just have to test it some more.

The teaesers look pretty cool.
Yes we need to plan a good delivery system. I suggest the same pattern as for the bikes skin (reusable code someone). Arena name + url to get it. When you join a server, you get a list of all the skins in use. You client should download them. During the download, you are on the server, but not fully joined. Once you have all the required arenas, your display is updated and you can join at the first opportunity.

Ok it is a pain in the bottox as you cant join now, but on the other hand, you dont disrupt the games for ppl who already have the maps. But I'm quite open for discussion about this.

Notice that I say at the first opportunity, not next turn. That is part of my wacky ideas to be detailled in a later post. One way of doing this would be in a "multiple life" game, you get to respawn as if you had been killed. Many more ways of doing this are possible.

-ph
Canis meus id comedit.
User avatar
philippeqc
Long Poster - Project Developer - Sage
Posts: 1526
Joined: Mon Jul 12, 2004 8:55 am
Location: Stockholm
Contact:

Post by philippeqc »

klax wrote:Yep, I've also noticed those limitations, but...

(0,0) the first point and only positive points -> we can use rotated shapes with a point always located in (0,0) and all the points being positive.

Another one is that it not supports L, U, ... shaped arenas. The arenas supported are only polygonal or with points not inside the described area, but well, that leave us lots of possibilities ;)

Tank: thanks for the tip ;)
Yes, I've noticed that everytime there is an "inside angle" it gets verrrrry weird. Sometime working with weird effects, sometime just killing everyone at start.

About a previous post, the arena I described works, but with unreacheble zones (if I recall properly, but as I'm contesting myself just minutes apart...)

I think it the code to detect if you are "in" the arena that assume no "inside angles". But havent had the chance to check it up.

Chupping a corner kills everyone I think [the (500,0) to (400,0) -> (400,100) -> (500,100)]

-ph
Canis meus id comedit.
User avatar
philippeqc
Long Poster - Project Developer - Sage
Posts: 1526
Joined: Mon Jul 12, 2004 8:55 am
Location: Stockholm
Contact:

Post by philippeqc »

klax wrote:More progressing in parsing spawnpoints from basic.aar ;)
The code right now it's a bit messy (but it works ;))

But... not only we could play with the shape of the arena.
We could also play with direction of the bikes at the beginning :twisted:

With this basic.aar:

Code: Select all

BEGIN_RIM
(0,0)
(500,0)
(500,500)
(0,500)
END

BEGIN_SPAWNPOINTS
(250,240) (0,-1)
(250,260) (0,1)
(240,250) (-1,0)
(260,250) (1,0)
END
you'll get this teaser 8)

You already have a basic parser running!!!! WOW

Humbly bows before you

-ph
Canis meus id comedit.
User avatar
klax
Project Developer
Posts: 481
Joined: Tue Jun 08, 2004 3:51 pm
Location: Barcelona, Spain
Contact:

Post by klax »

wb philipeqqc. We missed you ;)

All of this code surpasses me and I have lots of doubts.
Please answer to this post commenting my thoughts and the way you think it's the best to do this.

OK. Time to sum up the progress and some things I've been thinking about:

* The parser of aar is fully done (I've posted the code before). It parses the points of the grid and the spawnpoints. It was easy to do ;)
* I'm really lost about doing an implementation of downloading arena and which way will be the best for both servers/clients.
* Adding an ARENA field in server side is relatively easy to use (only needs to skip that message to be able to connect to older clients).


But my question is: how will we should send the arena description (arena.aar)? I've been thinking several ways:


1 Setting the above ARENA field linked to an http download of the arena.aar.

Advantadges: We could set the http link to something different of the server and the server will not have to send any extra data. For example: setting the server in UK and the http link hosted in France.
Disadvantadges: I've been looking at code to include and is not trivial to do an http download miniprogram (thinking of crossplatform support). In the worst case we could always use an external app like wget (it's crossplatform) to retrieve the file (I suppose it will be easy to start a thread in the code and when the son finish we could continue with the execution).


2 The arena is sent from the server. Here we have 2 possibilities:

2.1 The arena is described in a compacted way in ARENA field. Something like: ARENA 0,0,500,0,500,500,0,500#240,120,0,-1,260,120,...

Advantadges: the arenas will be sent from master server (I'm not sure about this, or we could test it using the now programmed URL field containing the compacted arena).
Disavantadges: More load in master server?

It's a way that I don't like a lot :?


2.2 The arena is sent from the server that is holding the arma server when you enter.

Advantadges: It's a more clean way that 2.1. We could add a state of Transferring the arena between rounds. If all the clients have the arena downloaded we will continue.
Disavatadges: This way all the clients have to wait the other client to download the arena. If someone needs the arena it will be sent from the server in next round (it's a bit shitty because the client connected in a middle of the round in theory will only see 'waiting for next round' lol).

We could also send the arena every round (I suppose the arena file will be from 1KB to 10KB in the worst cases).


Uff, I've been thinking a lot but I cannot post all my thoughts in a post (and always my shitty english) :?
Last edited by klax on Tue Jul 27, 2004 6:44 pm, edited 1 time in total.
User avatar
klax
Project Developer
Posts: 481
Joined: Tue Jun 08, 2004 3:51 pm
Location: Barcelona, Spain
Contact:

Post by klax »

philippeqc: Yes we need to plan a good delivery system. I suggest the same pattern as for the bikes skin (reusable code someone). Arena name + url to get it. When you join a server, you get a list of all the skins in use. You client should download them. During the download, you are on the server, but not fully joined. Once you have all the required arenas, your display is updated and you can join at the first opportunity.

Ok it is a pain in the bottox as you cant join now, but on the other hand, you dont disrupt the games for ppl who already have the maps. But I'm quite open for discussion about this.
Oh I miss reading all of this. Now my post is answered :?

Yep, it's the best way to do this and the best expandable way to add more things to arma.

And the question is... someone know how to do in c++ a http file retrieval in an easy and crossplatform way?
User avatar
Tank Program
Forum & Project Admin, PhD
Posts: 6712
Joined: Thu Dec 18, 2003 7:03 pm

Post by Tank Program »

Simple http downloader... hmmm... If wget is cross platform, and GPL, can we just borrow the code from wget then?
Image
User avatar
klax
Project Developer
Posts: 481
Joined: Tue Jun 08, 2004 3:51 pm
Location: Barcelona, Spain
Contact:

Post by klax »

OK. After searching for some http simple downloaders I've found this great page explaining some libraries:
http://curl.haxx.se/libcurl/competitors.html

After analyzing all the libs the best solutions are HTTP Fetcher (LGPL) and http-tiny (Artistic License).

I propose HTTP Fetcher (LGPL) (http://http-fetcher.sourceforge.net/) because:
1. The license (I don't know Artistic License well)
2. It's an alive project (last version is from 2004-03-07). http-tiny seems dead
3. It comes with really good documentation

I suppose this library will work easyly with other OSes. It also comes with one test file, and it seems simple to do.
k
Random Identifier & Project Developer
Posts: 345
Joined: Wed Feb 25, 2004 12:54 am
Location: Northern California, USA

Post by k »

DEPENDENCIES
============
HTTP Fetcher should run on most unices that support BSD-type sockets and have
a network connection. Developed and tested on x86 machines running recent
versions of RedHat.
After a quick glance I didn't notice anything about Windows compatability.
User avatar
philippeqc
Long Poster - Project Developer - Sage
Posts: 1526
Joined: Mon Jul 12, 2004 8:55 am
Location: Stockholm
Contact:

Post by philippeqc »

klax wrote:wb philipeqqc. We missed you ;)

All of this code surpasses me and I have lots of doubts.
We have to make a club of ppl confused by the code. (ppl = people)
klax wrote: Please answer to this post commenting my thoughts and the way you think it's the best to do this.
Ok, no probs.

I like your idea of using the field to send arenas definition or the url do download it. You could easily support both by starting the field with either "arena://" or "http://"

I think for now a simple "arena://" could work fine! The will stay quite small for a while. But remembering my quake days, it was frustrating to have to start the game and connect to a server just to start downloading the maps in use, and once downloaded, you'd join immediatly. As the process was VERY slow, you'd wait 25 minutes or more, and being bored of staring at a download screen, you'd have wandered far away from the screen, and ended up being the point maker of everybody.

I'd like a mechanism independant of the join-game. This way, you could just get a lot/ all the maps that you may need without bothering ppl with a zombie player once you received all the data. But it could be as simple as having a folder on the forum and just getting all the maps there.

But lets start with "arena://"
Canis meus id comedit.
User avatar
klax
Project Developer
Posts: 481
Joined: Tue Jun 08, 2004 3:51 pm
Location: Barcelona, Spain
Contact:

Post by klax »

philippeqc: I didn't get your idea of differencing arena:// and http://. What are you thinking when you say arena://??

Now I've done HTTP Fetcher work without installing any libraries. We could use it inside AA without installing any 3rd party library. I've tried in AA and it downloads an http file inside AA ;).

Now some more doubts:

When you enter a server it will connect to a http url to download the arena. Do u think we should save that file to any directory? That way the next time you connect to the server it will look in a local directory for the arena file.

But this way we'll have this problem: if the admin of the server updates the file and don't change the name, how will we detect if the file is new?

btw: the download of arena files will be semitransparent because of the few kbytes to download


k: Can you test if this minitest works in windows? You'll have to use the command line compiler of Visual C

Here is what I did to make it work the testfetch in linux:

Code: Select all

gcc -o testfetch testfetch.c http_error_codes.c http_fetcher.c

./testfetch
Page successfully downloaded. (www.google.com)
Attachments
fetchtest.zip
Simple http fetch
(11.35 KiB) Downloaded 234 times
k
Random Identifier & Project Developer
Posts: 345
Joined: Wed Feb 25, 2004 12:54 am
Location: Northern California, USA

Post by k »

klax wrote:k: Can you test if this minitest works in windows? You'll have to use the command line compiler of Visual C
I'm not going to be able to try it for a week and a half. If someone else doesn't try it by then (maybe Tank?) I'll look at it. I've been swamped at work the last two weeks (3 clients, multiple projects per client) :? and I'm going on vacation for a week. Going to Yosemite. I'll see if I can swipe my wifes Digital Rebel and take some pics. Maybe if I leave some food in her car I can get a picture of a bear. :twisted:
User avatar
Tank Program
Forum & Project Admin, PhD
Posts: 6712
Joined: Thu Dec 18, 2003 7:03 pm

Post by Tank Program »

This would be easier to compile if I could find the command line tools...
Image
User avatar
Tank Program
Forum & Project Admin, PhD
Posts: 6712
Joined: Thu Dec 18, 2003 7:03 pm

Post by Tank Program »

Fails on netdb.h... On the brightside I can compile it in CYGWIN and run it, not that that does us any good...
Image
User avatar
klax
Project Developer
Posts: 481
Joined: Tue Jun 08, 2004 3:51 pm
Location: Barcelona, Spain
Contact:

Post by klax »

Tank: can u post the error output about netdb.h? And if I understood it right it compiles succesfully in cygwin, but all the AA can be compiled in windows on cygwin/mingw?
User avatar
Tank Program
Forum & Project Admin, PhD
Posts: 6712
Joined: Thu Dec 18, 2003 7:03 pm

Post by Tank Program »

I'll post more details tomorrow... Too late tonight...
Image
Post Reply