December 23, 2024, 05:10:55 am

The Gang Garrison 2 Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

NOTICE: Wondering where all the forums have gone?

Join the community Discord server!

Pages: 1 ... 68 69 [70] 71 72 ... 77

Author Topic: Official PyGG2 Development thread  (Read 161098 times)

Saniblues

  • Onion Knight
  • Administrator
  • *****
  • Karma: -1305
  • Offline Offline
  • Posts: 12206
Re: Official PyGG2 Development thread
« Reply #1035 on: October 30, 2012, 11:55:57 am »

This conversation derails itself
Logged
Quote from: mop
Quote from: MR MAGN3TIC
I don't like it.  :nah:
Oh, well, you might as well pack up and stop now, because he doesn't like it
I'm bored out of my skull, Lets play a different game!
Lets take a visit down below And cast the world in flames!

Orpheon

  • Moderator
  • *****
  • Karma: 15
  • Offline Offline
  • Posts: 6409
  • Developer
Re: Official PyGG2 Development thread
« Reply #1036 on: October 30, 2012, 12:13:30 pm »

I'll add my two cents and say that python has a built-in zip interface which makes it rather simple to handle archives.

A_SN, try to find a smart map format for the wallmask (list of polygons/maybe only convex ones, not sure), and then try to find a way to convert a standard bitmask into one such wallmask.
Again, if you need bitmask loading/usage, there's the mask extension in PyGG2 that might interest you, apart from that there's very little already decided and done. You might want to discuss with NAGN the exact file format, but as default assume a zip file with a lot of files including yours.

hey orph don't get discouraged because people say python is horrible


keep it up man
after seeing that parallax demo I'm inclined to work on it again.

First thing I'd do would be make an installer or working executable so people can actually try it.

And a working update mechanism.
Great idea, do that. My first reflex would be cython, as pySFML is already cython and so is guaranteed compatible.
« Last Edit: October 30, 2012, 12:19:09 pm by Orpheon »
Logged

ajf

  • Guest
Re: Official PyGG2 Development thread
« Reply #1037 on: October 30, 2012, 12:52:04 pm »

Actually, I think python has some installer framework. At least, I notice that pygame and some other libraries share the installer.

Also, re: map format, Python has excellent built-in JSON support.
« Last Edit: October 30, 2012, 12:52:22 pm by Mystia Lorelei »
Logged

cspotcode

  • Coder
  • Administrator
  • *****
  • Karma: 134
  • Offline Offline
  • Posts: 412
Re: Official PyGG2 Development thread
« Reply #1038 on: October 30, 2012, 12:57:28 pm »

Also, re: map format, Python has excellent built-in JSON support.

Aww yisss, all my old map format ideas were JSON-based.
Logged
"The knack of flying is learning how to throw yourself at the ground and miss."
- Douglas Adams

ajf

  • Guest
Re: Official PyGG2 Development thread
« Reply #1039 on: October 30, 2012, 01:12:27 pm »

Also, re: map format, Python has excellent built-in JSON support.

Aww yisss, all my old map format ideas were JSON-based.
Of course. It's a wonderful, lightweight-yet-flexible serialisation format, and it's human-readable!
Logged

Orpheon

  • Moderator
  • *****
  • Karma: 15
  • Offline Offline
  • Posts: 6409
  • Developer
Re: Official PyGG2 Development thread
« Reply #1040 on: October 30, 2012, 01:20:20 pm »




No, actually I don't care as long as everything is separated and packed in a nice zip file.
Although I don't see the advantage of JSON for wallmask data, that would be better done in a raw byte string.
« Last Edit: October 30, 2012, 01:21:21 pm by Orpheon »
Logged

Phantom Brave

  • All Hail Classicwell
  • Moderator
  • *****
  • Karma: 70
  • Offline Offline
  • Posts: 12532
  • Another one --
Re: Official PyGG2 Development thread
« Reply #1041 on: October 30, 2012, 01:25:32 pm »

A raw byte string that you need to write a decoder for. JSON is simpler to parse and code for when you want to expand it.
Logged

http://steamcommunity.com/id/wareya/
ladies and gentlemen i would like to announce that the fact of the matter is up that the fact of the matter is a fact and it matters

Orpheon

  • Moderator
  • *****
  • Karma: 15
  • Offline Offline
  • Posts: 6409
  • Developer
Re: Official PyGG2 Development thread
« Reply #1042 on: October 30, 2012, 01:30:36 pm »

You need the same if not less code to transcribe a lot of bits from a binary file than from a JSON file, the only difference is that the JSON file needs 8 times as much memory.
Logged

Phantom Brave

  • All Hail Classicwell
  • Moderator
  • *****
  • Karma: 70
  • Offline Offline
  • Posts: 12532
  • Another one --
Re: Official PyGG2 Development thread
« Reply #1043 on: October 30, 2012, 01:32:28 pm »

memory is cheap
rewriting code and trying to be backwards compatible like gmgg2 now, isn't
Logged

http://steamcommunity.com/id/wareya/
ladies and gentlemen i would like to announce that the fact of the matter is up that the fact of the matter is a fact and it matters

Orpheon

  • Moderator
  • *****
  • Karma: 15
  • Offline Offline
  • Posts: 6409
  • Developer
Re: Official PyGG2 Development thread
« Reply #1044 on: October 30, 2012, 01:34:05 pm »

Whatever, we'll argue about this once it becomes an issue. It'll be a matter of 3 lines anyways, so yeah.
Logged

cspotcode

  • Coder
  • Administrator
  • *****
  • Karma: 134
  • Offline Offline
  • Posts: 412
Re: Official PyGG2 Development thread
« Reply #1045 on: October 30, 2012, 01:42:03 pm »

Actually, my original plan was to represent all collision masks as bitstreams, base64-encode them, and store the resulting string in the JSON alongside "width" and "height" values.  It might seem ugly, but it's also easy, straightforward, and unsurprising.  All good things.

Since the whole map will be in a ZIP file, the DEFLATE compression will eliminate a lot of the redundant bytes in JSON.

And, finally, if you really don't want the wallmask data inside the JSON, we can store its raw bitstream in a file in the zip and reference it from the JSON config.

Agreed with Orpheon: not a big deal either way.
Logged
"The knack of flying is learning how to throw yourself at the ground and miss."
- Douglas Adams

MedO

  • Owns this place
  • *****
  • Karma: 151
  • Offline Offline
  • Posts: 1754
Re: Official PyGG2 Development thread
« Reply #1046 on: October 30, 2012, 01:53:52 pm »

Wow, suddenly two pages of posts and cspotcode appears. Yay :D

For easy map sharing, you could make a map-sharing webapp (maps.ganggarrison.com or ganggarrison.com/maps?).  Users upload their maps and get a nice URL where people can view a written description, see thumbnails, and download the map.  Garrison Builder could generate the thumbnails and store them into the zip, meaning the webapp wouldn't have to do any fancy rendering.

This sounds like the perfect job for AJF if he's interested.

Although I don't see the advantage of JSON for wallmask data, that would be better done in a raw byte string.

Agreed, JSON is good for structured data but I'd keep the wallmask - which is basically an image - in a format designed for storing images, i.e. PNG. I see the following advantages:
- smaller level files
- easier to access/edit wallmask without special tools
- readable JSON (I'd say having it broken up by a big base64 or hex string reduces that)
- probably less code

JSON is simpler to parse and code for when you want to expand it.
A wallmask is an image. What do you want to expand about that? You can reference it from the JSON if you want, and add metadata about it there (same with other images btw, think custom entity graphics), but what do you gain in expandability by storing the image data itself in JSON?
Logged
Quote from: Alfred North Whitehead
It is the business of the future to be dangerous; and it is among the merits of science that it equips the future for its duties.

Quote from: John Carmack
[...] if you have a large enough codebase, any class of error that is syntactically legal probably exists there.

Orpheon

  • Moderator
  • *****
  • Karma: 15
  • Offline Offline
  • Posts: 6409
  • Developer
Re: Official PyGG2 Development thread
« Reply #1047 on: October 30, 2012, 02:13:58 pm »

Also, I might add that the goal is to move away from wallmasks, and to whatever vector collision format we want.
Logged

Phantom Brave

  • All Hail Classicwell
  • Moderator
  • *****
  • Karma: 70
  • Offline Offline
  • Posts: 12532
  • Another one --
Re: Official PyGG2 Development thread
« Reply #1048 on: October 30, 2012, 02:35:01 pm »

Yeah, and that's where the fatal flaw in communication here lies.
Logged

http://steamcommunity.com/id/wareya/
ladies and gentlemen i would like to announce that the fact of the matter is up that the fact of the matter is a fact and it matters

ajf

  • Guest
Re: Official PyGG2 Development thread
« Reply #1049 on: October 30, 2012, 02:47:07 pm »

For easy map sharing, you could make a map-sharing webapp (maps.ganggarrison.com or ganggarrison.com/maps?).  Users upload their maps and get a nice URL where people can view a written description, see thumbnails, and download the map.  Garrison Builder could generate the thumbnails and store them into the zip, meaning the webapp wouldn't have to do any fancy rendering.

This sounds like the perfect job for AJF if he's interested.
After my (failed) map hosting service, I've had this idea for a while. gg2maps.ajf.me may become a reality if we get a new format.

Having thumbnails in the zip would also mean the opportunity for a pretty map-selection interface in GG2 :D
« Last Edit: October 30, 2012, 02:47:44 pm by Mystia Lorelei »
Logged
Pages: 1 ... 68 69 [70] 71 72 ... 77
 

Page created in 0.028 seconds with 36 queries.