Teaser: Map editor screenshot

What do you want to see in Armagetron soon? Any new feature ideas? Let's ponder these ground breaking ideas...
User avatar
Jonathan
A Brave Victim
Posts: 3391
Joined: Thu Feb 03, 2005 12:50 am
Location: Not really lurking anymore

Post by Jonathan »

Lucifer: the edit was because it contained a mistake. Also, when fixed it would only be useful to find whether a point lies EXACTLY on the line segment. I suppose you want to do something with mouse clicks, so do you want a function that finds the distance (usable with a threshold and to compare to others), and where you hit it (near end point 1, end point 2 or in between)? I can write some C pseudocode for that.
ˌɑrməˈɡɛˌtrɑn
User avatar
Tank Program
Forum & Project Admin, PhD
Posts: 6712
Joined: Thu Dec 18, 2003 7:03 pm

Post by Tank Program »

Well, if you express the line segment as a vector equation...

Code: Select all

     ( start x ) + t ( distance to x 2)
 r = ( start y )     ( distance to y 2)
If a point is on that line (r), it will be between the x and y values, a both the x and y of r will be the same multiple of t... Or something like that.
Image
User avatar
Lucifer
Project Developer
Posts: 8747
Joined: Sun Aug 15, 2004 3:32 pm
Location: Republic of Texas

Post by Lucifer »

Tank Program wrote:How about grid colors like that of the actual game grid?
Thought about that seriously, but decided I wanted a black on white display. Now it's working towards a white on black display, but there are many more colors that display well on white than there are on black.

Anyway, I moved all the colors in the key classes to the top of the classes, so it's easy to experiment with different color schemes. :) I'm liking how it looks right now, but I haven't yet tried to make a whole map with it. It still needs a few things it doesn't have, I think, but I'll bet if I wrapped up the windows version people would start using it.

Anyway, still needs a way to specify the direction of a spawn point, and a way to specify other properties on the map (number of axes, a few other things). I was thinking a property panel would be right, and what it shows would vary depending on what tool was selected and what grid objects were selected.

Also needs the map object more or less rewritten, as well as the mapView. What's there is just stuff I threw in there, remember my focus was on the widget set, so those two particular items were just kinda hacked together.
Check out my YouTube channel: https://youtube.com/@davefancella?si=H--oCK3k_dQ1laDN

Be the devil's own, Lucifer's my name.
- Iron Maiden
User avatar
Lucifer
Project Developer
Posts: 8747
Joined: Sun Aug 15, 2004 3:32 pm
Location: Republic of Texas

Post by Lucifer »

Oh yeah, Jonathan. I wound up just doing a distance from a point on the wall. The internal data structures store the walls as they're listed in the xml file, as a series of points. Python's math module has this nice function hypot that does sqrt(a^2 + b^2), and I assume it does it in the C library rather than in Python. So I wound up with reasonable performance, just remember you select walls by hovering near a point on the wall.

I'll still need some way to draw a line through a wall and slice the wall at that point, but I think before that I need a "move point" feature in the editor itself. The idea is that you'd draw a long wall with many segments and then you'd slice it up where you wanted it sliced, the two endpoints would snap apart to their nearest locations on the grid and then you could select one or both of those points and drag them around.

Of course, before that happens we'll probably have circles, boxes, and polygons available. It'd be nice to have an arc tool also, but that's just a variation of a circle tool anyway. Then we'll need to be able to slice the circles or just delete points from the circles. ;)
Check out my YouTube channel: https://youtube.com/@davefancella?si=H--oCK3k_dQ1laDN

Be the devil's own, Lucifer's my name.
- Iron Maiden
User avatar
Jonathan
A Brave Victim
Posts: 3391
Joined: Thu Feb 03, 2005 12:50 am
Location: Not really lurking anymore

Post by Jonathan »

C hypot looks the same:
man hypot wrote:The hypot() function computes the sqrt(x*x+y*y) without undue overflow or underflow.
Line segment intersection
Attachments
linesegmentintersection.png
linesegmentintersection.png (11.25 KiB) Viewed 3566 times
ˌɑrməˈɡɛˌtrɑn
User avatar
Lucifer
Project Developer
Posts: 8747
Joined: Sun Aug 15, 2004 3:32 pm
Location: Republic of Texas

Post by Lucifer »

Waaa. No code? ;)

Anyway, here's another screenshot, it includes the delete button and the panel with the basic map properties is moved a bit. You'll see the panel there now supports fonts other than pygame's boring default font, and z-man's requested category field is there now.
Attachments
Yippeee another screenshot.
Yippeee another screenshot.
Check out my YouTube channel: https://youtube.com/@davefancella?si=H--oCK3k_dQ1laDN

Be the devil's own, Lucifer's my name.
- Iron Maiden
User avatar
Jonathan
A Brave Victim
Posts: 3391
Joined: Thu Feb 03, 2005 12:50 am
Location: Not really lurking anymore

Post by Jonathan »

Lucifer wrote:Waaa. No code? ;)
No, but I do have a movie.

(the code is basically a C version of the page I mentioned, written in like 2 seconds)
Attachments
intersection.mp4.gz
Needs something that knows H.264 (/me is testing). QT7 works perfectly. The MPlayer I have here works good enough to see what's going on.
(76.06 KiB) Downloaded 225 times
ˌɑrməˈɡɛˌtrɑn
User avatar
Lucifer
Project Developer
Posts: 8747
Joined: Sun Aug 15, 2004 3:32 pm
Location: Republic of Texas

Post by Lucifer »

Hmm, neither mplayer nor the other one (amarok?) played it. :(

On the bright side, I made spawn points point in the right direction (thanks nemo!). Now back to studying.... (chem test tomorrow, you know)
Check out my YouTube channel: https://youtube.com/@davefancella?si=H--oCK3k_dQ1laDN

Be the devil's own, Lucifer's my name.
- Iron Maiden
User avatar
Jonathan
A Brave Victim
Posts: 3391
Joined: Thu Feb 03, 2005 12:50 am
Location: Not really lurking anymore

Post by Jonathan »

Lucifer wrote:Hmm, neither mplayer nor the other one (amarok?) played it. :(
MPlayer OS X 2b8r5 which I used to test works (except the first frames appear to be based on nothing), and the MPlayer page itself lists some H.264 stuff. The dates over there look old, but is it possible you have an even older version?
ˌɑrməˈɡɛˌtrɑn
User avatar
Lucifer
Project Developer
Posts: 8747
Joined: Sun Aug 15, 2004 3:32 pm
Location: Republic of Texas

Post by Lucifer »

It's more likely that I haven't installed the win32 codec package, because I haven't. iirc, that's how mplayer in Linux shows quicktime movies. It can detect them without the package, but it can't decode the streams.
Check out my YouTube channel: https://youtube.com/@davefancella?si=H--oCK3k_dQ1laDN

Be the devil's own, Lucifer's my name.
- Iron Maiden
User avatar
Jonathan
A Brave Victim
Posts: 3391
Joined: Thu Feb 03, 2005 12:50 am
Location: Not really lurking anymore

Post by Jonathan »

The container is supposed to be MPEG-4 Part 14 and the codec Part 10, and the MPlayer page lists it under ffmpeg (which uses x264), so I doubt you need a win32 codec package.
ˌɑrməˈɡɛˌtrɑn
Luke-Jr
Dr Z Level
Posts: 2246
Joined: Sun Mar 20, 2005 4:03 pm
Location: IM: luke@dashjr.org

Post by Luke-Jr »

Lucifer wrote:Ok, I am definitely ready to put this thing into cvs. So what's the consensus?
nemo kinda set a precedent by putting the OSX recording program in the armagetronad project...
Lucifer wrote:To release it for all to use, it still needs a file dialog and an eraser, and a little bit more feedback from the save button (a short animation will suffice). It also needs to be kept updated with changes to the map file format. :)
It'd be cool if it could be ported/modified to work in a browser, too ;)
Luke-Jr
Dr Z Level
Posts: 2246
Joined: Sun Mar 20, 2005 4:03 pm
Location: IM: luke@dashjr.org

Post by Luke-Jr »

Lucifer wrote:
Tank Program wrote:How about grid colors like that of the actual game grid?
Thought about that seriously, but decided I wanted a black on white display. Now it's working towards a white on black display, but there are many more colors that display well on white than there are on black.
In my experience, it seems to me that there are more black-bg colours than there are white-bg colours... in particular, when I setup the server list to flip server/player colour codes (to make them white-bg instead of black-bg), I found some didn't look too good...
Lucifer wrote:Anyway, still needs a way to specify the direction of a spawn point, and a way to specify other properties on the map (number of axes, a few other things). I was thinking a property panel would be right, and what it shows would vary depending on what tool was selected and what grid objects were selected.
Plan for the future: zones will need different properties, so a panel sounds good.
Lucifer wrote:It's more likely that I haven't installed the win32 codec package, because I haven't. iirc, that's how mplayer in Linux shows quicktime movies. It can detect them without the package, but it can't decode the streams.
ffmpeg can decode various Quicktime stuff, last I checked...
User avatar
Jonathan
A Brave Victim
Posts: 3391
Joined: Thu Feb 03, 2005 12:50 am
Location: Not really lurking anymore

Post by Jonathan »

This got me wondering, would a container/codec more related to QT work? :?
Attachments
intersection_animation.mov.gz
Animation is a lossless RLE codec. Doesn't sound too hard to encode/decode, but I'm not sure if there's support for it.
(140.84 KiB) Downloaded 195 times
intersection_sorenson3.mov.gz
http://en.wikipedia.org/wiki/Sorenson_codec says they got this working.
(68.28 KiB) Downloaded 186 times
ˌɑrməˈɡɛˌtrɑn
User avatar
Lucifer
Project Developer
Posts: 8747
Joined: Sun Aug 15, 2004 3:32 pm
Location: Republic of Texas

Post by Lucifer »

More screenshots. Found an interesting bug, fixing it made the alphas work on all the surfaces. :)

Now guess what new feature I was working on? You'll also notice how broken the map view is. That's by design. :) It's a broken design, obviously....


(hint: notice the *size* of the screenshots)
Attachments
acme.png
acme1.png
acme2.png
Check out my YouTube channel: https://youtube.com/@davefancella?si=H--oCK3k_dQ1laDN

Be the devil's own, Lucifer's my name.
- Iron Maiden
Post Reply