Jump to content


Photo

[BEL] SecEditor 3

bel tool sector

  • Please log in to reply
49 replies to this topic

#21 herbert3000

herbert3000

    Guilty Until Proven Innocent

  • Division Admins
  • 610 posts
  • Location:Austria
  • Division:Commandos HQ
  • Job:Division Admin

Posted 06 October 2017 - 08:19 PM

Great! I checked few maps, all works correct.
However, some large maps at me does not open. As well this map:

Thanks for the SEC file and the error message. I was able to track down the problem, looks like there's a bug in JavaFX which leads to this error if the width or height of the window is > 8192 pixels. Just reported the bug, hopefully it will be fixed soon.

 

In the meanwhile try to keep the total width and height below 8192.

total width = map width + offset * 2

if you zoom in, the total width is multiplied by 1.5



#22 Salvadorc17

Salvadorc17

    title available

  • Members
  • 507 posts
  • Location:Colombia
  • Projects:Destination Norway

Posted 06 October 2017 - 08:23 PM

In the meanwhile try to keep the total width and height below 8192.
total width = map width + offset * 2
if you zoom in, the total width is multiplied by 1.5


So that means no c2 to c1 compatible maps right now?

#23 herbert3000

herbert3000

    Guilty Until Proven Innocent

  • Division Admins
  • 610 posts
  • Location:Austria
  • Division:Commandos HQ
  • Job:Division Admin

Posted 06 October 2017 - 08:36 PM

So that means no c2 to c1 compatible maps right now?

Depends on the size of the C2 map :)

 

@dialog: Do you get the error as soon as you open C2M10.SEC? Because I can open the SEC, it only crashes when I zoom in.



#24 dialog

dialog
  • Members
  • 117 posts
  • Location:Russia

Posted 07 October 2017 - 11:30 AM

@dialog: Do you get the error as soon as you open C2M10.SEC? Because I can open the SEC, it only crashes when I zoom in.


This error occurs when opening.
But now i try load other small map at first, and zoom out. After this C2M10 map opened normally in reduced scale.
So, i can't zoom in any maps. I press "+", but nothing happened. However zoom out works.

#25 Jovan

Jovan
  • Members
  • 7 posts

Posted 09 October 2017 - 06:34 AM

Herbert - this is fantastic!! What in god's name are you doing working on this in 2017?! :)



#26 Zakxaev68

Zakxaev68

    Stalking in the shadows

  • Members
  • 163 posts
  • Location:Bulgaria

Posted 14 October 2017 - 02:56 PM

If ever Commandos "pops" (hahah) new game in same vein of its predecessors, sign your papers for tool chain designer assistant. Chinese community also get hired, for sure!


comm-boot-camp-promo-revora-join-us-co.p


<<< CLICK ON THE IMAGE TO DO SO >>>


#27 herbert3000

herbert3000

    Guilty Until Proven Innocent

  • Division Admins
  • 610 posts
  • Location:Austria
  • Division:Commandos HQ
  • Job:Division Admin

Posted 22 October 2017 - 01:54 AM

Hey guys, I've uploaded a new version with minor changes.

You can now see the sectors in (pseudo) 3D and you can load a sector file or background image by dropping the file onto the application.

screenshot.png

 

I reported the bug (see previous posts) but according to a comment it's a "long-standing and well-known issue." So it probably won't be fixed soon, I guess I'll have to work around it somehow.

http://bugs.java.com...?bug_id=8189082



#28 Maurice1976

Maurice1976
  • Members
  • 85 posts

Posted 22 October 2017 - 11:39 AM

How bad is it when I instantly recognize the mission of the SEC file you used? :p



#29 herbert3000

herbert3000

    Guilty Until Proven Innocent

  • Division Admins
  • 610 posts
  • Location:Austria
  • Division:Commandos HQ
  • Job:Division Admin

Posted 23 October 2017 - 06:36 AM

How bad is it when I instantly recognize the mission of the SEC file you used? :p

It would be bad if you didn't recognize it. :wink_new:

The consequences would be a lifetime ban from this forum! :xd:



#30 Maurice1976

Maurice1976
  • Members
  • 85 posts

Posted 23 October 2017 - 08:22 AM

It would be bad if you didn't recognize it. :wink_new:

 

The consequences would be a lifetime ban from this forum! :xd:

 

 

Must memorize all Commandos missions! Must memorize all Commandos missions! Must memorize all Commandos missions! :p



#31 Zakxaev68

Zakxaev68

    Stalking in the shadows

  • Members
  • 163 posts
  • Location:Bulgaria

Posted 23 October 2017 - 10:38 AM

Only if sound engine was accessible much as maps. Oh boy oh boyy by now I'd have some extra cool gun effects from Behind Enemy Lines, among others.

 

Schuuuuuuckssss


comm-boot-camp-promo-revora-join-us-co.p


<<< CLICK ON THE IMAGE TO DO SO >>>


#32 herbert3000

herbert3000

    Guilty Until Proven Innocent

  • Division Admins
  • 610 posts
  • Location:Austria
  • Division:Commandos HQ
  • Job:Division Admin

Posted 24 October 2017 - 08:26 AM

Uploaded another update.

 

It should now be impossible to import malformed SEC files, the application will inform you about any errors (and also tells you the line number).

Creating an invalid sector is also impossible, it checks if the sector is convex, if the points are in clockwise order, if the sector has at least 3 points and if there are any duplicate points.

 

Now it's also possible to create inclined sectors (like stairs or ramps). The only requirement is that the sector has exactly 4 points.

Usage is quite simple. First set the height of the top and the bottom sector (marked with 1 and 2 on screenshot), then click on the sector that should become a ramp (3) and then just check the check box :)

screenshot.png

 

At the moment the application doesn't draw the ramp the way it should look like but that's only because I was too lazy to implement that feature :D That's just an aesthetic issue, the actual values are correct.

 

My TODO list:

- display the stairs (and also recalculate the values if the points or the height of the surrounding sectors change)

- fix the zoom

- allow to save sector file in Commandos 2 format

- add option for hiding the points

- work around the bug in the Java framework (see previous posts)



#33 dialog

dialog
  • Members
  • 117 posts
  • Location:Russia

Posted 24 October 2017 - 10:40 AM

Excellent features!  :good: Yet it would be convenient, if when creating new sectors, clicked points will change color.
 

I reported the bug (see previous posts) but according to a comment it's a "long-standing and well-known issue." So it probably won't be fixed soon, I guess I'll have to work around it somehow.
http://bugs.java.com...?bug_id=8189082


:sad:, but so - such scales are not required for most maps.



#34 Maurice1976

Maurice1976
  • Members
  • 85 posts

Posted 24 October 2017 - 11:15 AM

I was thinking of something: when you design the sector map, there are a number of sectors that matter because of their attributes. However, eventually you will have a number of "default" sectors that are just filler. Would it be possible to create some code where you could tell the editor to generate the remaining sectors automatically with default parameters? That would speed up that part of the process by taking it out of your hands.

 

If you already have a convex checker routine, that should help a lot to find proper point sets that can make up these automatically created sectors.



#35 herbert3000

herbert3000

    Guilty Until Proven Innocent

  • Division Admins
  • 610 posts
  • Location:Austria
  • Division:Commandos HQ
  • Job:Division Admin

Posted 24 October 2017 - 05:40 PM

Excellent features!  :good: Yet it would be convenient, if when creating new sectors, clicked points will change color.

Thanks, I'll add it to my list. When you are not sure if you already clicked a point, just click it again, the application won't add the point again if it's already in the sector.
 

I was thinking of something: when you design the sector map, there are a number of sectors that matter because of their attributes. However, eventually you will have a number of "default" sectors that are just filler. Would it be possible to create some code where you could tell the editor to generate the remaining sectors automatically with default parameters? That would speed up that part of the process by taking it out of your hands.
 
If you already have a convex checker routine, that should help a lot to find proper point sets that can make up these automatically created sectors.

Yeah, that would be a great feature!
But I have a feeling that this won't be easy.
Right now I'm wrapping my head around finding an elegant solution for an unfinished sector map like this:
Screenshot (356).png

#36 Maurice1976

Maurice1976
  • Members
  • 85 posts

Posted 24 October 2017 - 06:36 PM

You'd have to do a near point evaluation and determine two things:

- Is the point found already connected to the point you're starting from?

- Is the connecting line crossing space that's not part of a sector?

- Is the connecting line not crossing any other line(s)?

 

If the answer to the first is no and the second and third is yes, you have a starting line from which to begin building the first automatic sector. You'd probably need to evaluate all points, so it might be wise to keep track of whether points are still (partially) in the open, or completely enclosed by sectors. You can skip points of the latter category.



#37 herbert3000

herbert3000

    Guilty Until Proven Innocent

  • Division Admins
  • 610 posts
  • Location:Austria
  • Division:Commandos HQ
  • Job:Division Admin

Posted 24 October 2017 - 08:48 PM

Hm, I think I'll have to adjust my data structure.

At the moment I have a list of points (each point has the properties x and y) and a list of sectors (where each sector has a list of points).
I'd like to introduce edges (where each edge consists of two points). In addition each edge store a reference to one or two sectors (if sectors are neighbors, then they share the same edge).

With that data structure, I'd only have to add all edges that don't have a second sector to a list.
From that list, I'd have to remove all edges that define the outer map border.

From the remaining open edges, I'd have to create candidates for new edges (by trying to connect each point with any other point and check if the new edge doesn't intersect an existing edge).
The result after that process should be something like that:
valid_edges.png
The next step would be to create triangles from the edge candidates and the open edges (possibly starting with the shortest edge candidate). Repeat as long as there are open edges left.

Extra task: merge triangles into convex polygons if possible (actually this algorithm should run over all sectors, not only the automatically created ones).

 

Does this make sense or did I overlook something?



#38 Maurice1976

Maurice1976
  • Members
  • 85 posts

Posted 24 October 2017 - 09:41 PM

That is also a way of looking at it. Just take the points that are on the ends of open edges, as both these points are (partially) open as well. Then, have the editor draw edges between all these points as you did above (basically connecting all the points that can "see" eachother without having to cross over defined sectors / edges that are associated with at least one defined sector).

 

You can then start deleting these editor generated edges for which the following applies:

- Looking at one of the two points on the ends of the edge you're evaluating, take the edge to the left of it, connecting to that same point;

- Take the one on the right as well and determine the angle between the edge on the left and the right;

- Do the same for the point at the other side of the edge you're evaluating;

 

If both resulting angles are less than 180 degrees, you can delete the edge you're evaluating. That should minimize the number of sectors the editor would need to create. You would need to evaluate all the edges your editor has drawn this way, to see if they can safely be deleted. Once you've deleted the superfluous ones, you are left with the minimum you need to automatically generate all the remaining missing sectors.

 

Take a look at this example to more clearly see what I mean:

DeleteSectorEdges.png

 

If you consider the purple edge, you can delete it, because it meets all criteria above:

- For the point in the lower left, the yellow edges on either side of it still have a convex angle;

- For the point in the upper right of that egde, the dark red edges on either side still have a convex angle;

The same applies to the blue dotted edge intersected by the purple one, by the way.

 

The yellow edge to the right of the purple one can't be deleted, however. Even if the remaining angle at the point in the bottom left is still convex, the remaining angle for the corner to which the yellow edge connects on the pink box would be larger than 180 degrees.


Edited by Maurice1976, 24 October 2017 - 09:46 PM.


#39 herbert3000

herbert3000

    Guilty Until Proven Innocent

  • Division Admins
  • 610 posts
  • Location:Austria
  • Division:Commandos HQ
  • Job:Division Admin

Posted 28 October 2017 - 08:47 PM

First step of the automatic sector creation done.

Screenshot (359).png

Screenshot (360).png

Next step: combine the triangles to convex polygons (not really necessary, the game also works with triangles).



#40 Lexx2k

Lexx2k
  • Members
  • 133 posts
  • Location:Berlin
  • Projects:BTCOD Mission Pack

Posted 29 October 2017 - 11:23 AM

As someone with a bit more 3d modelling experience, the polygon placement above looks disgusting in many places. :> It's one of these things I'd rather do by hand, to avoid a shitty outcome. On the other hand, Commandos is an old game now, and the hardware of today doesn't really need all that detail optimization anymore.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users