Heroes 4 Advanced Options Map Editor
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: Heroes 4 Map Generator / Utility
So I noticed after I sent the initial delivery to Kalah that I forgot to implement adding new events, so I went ahead and got that taken care of.
I also started on the area selection tool, and have implemented the drawing portion. There's a new icon on the toolbar for this (see below).
Once you have clicked the selection tool icon, simply left click and drag to enclose the area you would like to select.
The freeform will close itself on mouse release. If you left click and drag a second time, it will clear the old selected area and you will be drawing a new one.
So far that's all it does. I need to determine how I'm going to approach grabbing everything inside the boundary so it's done in a reasonable way. I'll also need to decide how I will determine if the selected area is right clicked to view more options (probably if the user right clicks inside or near the drawn area).
I also started on the area selection tool, and have implemented the drawing portion. There's a new icon on the toolbar for this (see below).
Once you have clicked the selection tool icon, simply left click and drag to enclose the area you would like to select.
The freeform will close itself on mouse release. If you left click and drag a second time, it will clear the old selected area and you will be drawing a new one.
So far that's all it does. I need to determine how I'm going to approach grabbing everything inside the boundary so it's done in a reasonable way. I'll also need to decide how I will determine if the selected area is right clicked to view more options (probably if the user right clicks inside or near the drawn area).
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: Heroes 4 Map Generator / Utility
Update: I got to the point where I am able to copy all objects within a selected area. I haven't done a paste yet to another map, but that will be simple.
Next I'll need to work on getting the terrain rows and columns that are selected and save those. After that is elevation, but I'll probably leave that until later.
I also need to get the mechanism in place to actually tell the H4MG to "Copy selected area", which will likely consist of a context menu that can be accessed by right clicking.
Next I'll need to work on getting the terrain rows and columns that are selected and save those. After that is elevation, but I'll probably leave that until later.
I also need to get the mechanism in place to actually tell the H4MG to "Copy selected area", which will likely consist of a context menu that can be accessed by right clicking.
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: Heroes 4 Map Generator / Utility
Just wanted to announce that going forward, this project will be associated with Equilibris.
I'll still post progress on the things I've been working on, but will probably not post as much about the Equilibris specific tasks that are being applied to the H4MG until we've reached a certain point.
I'll still post progress on the things I've been working on, but will probably not post as much about the Equilibris specific tasks that are being applied to the H4MG until we've reached a certain point.
- Steven Aus
- War Dancer
- Posts: 350
- Joined: 08 Feb 2006
- Location: Perth, Australia
- Contact:
Re: Heroes 4 Map Generator / Utility
I want to congratulate you on all the work you've done to develop and release the H4MG, and now get it included with Equilibris. It's a fantastic effort you've done for the community.
My Life Purpose Is To Teach The World To Fish For Life. I AM Steven Russell Lynch Abundance That I AM. Empowerment And Fostering Self-Responsibility Is My Game.
Re: Heroes 4 Map Generator / Utility
Indeed it's stuff like this that keeps H4 and the older ones alive, and it's Great to see it being linked with Equilibris - that brings hope of more new stuff.
I'm silent in seven languages - and I got all my familys fear.
Everytime you throw dirt, you loose a little ground
Everytime you throw dirt, you loose a little ground
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: Heroes 4 Map Generator / Utility
Thanks guys I'd definitely like to generate and see more interest in H4!
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: Heroes 4 Map Generator / Utility
Alright! So I have successfully copied objects and terrain (still work to be done for elevation) between maps of the same size! I still have some work to do with maps of different sizes (mostly converting rows and columns between the different sizes).
I'll try to get some screen shots or a demo video posted soon
I'll try to get some screen shots or a demo video posted soon
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: Heroes 4 Map Generator / Utility
Hello again! Here are some screen shots for the copy and paste of an area on a map. Eventually I'll get around to creating some demo videos for the important pieces.
First, I've opened up two maps of the same size (both XL).
Next, we select an area to copy, then right click on the map window and select "copy".
Now, we go to the second map, right click it, and select "paste".
Bam! Now the selected data has been copied to the new map. Don't forget to save your changes!
Lastly, we can open the map in the editor to have a look. Check out the mini map.
A couple notes: 1) The current way copying and pasting portions of a map is done is kind of hacked together, and is not exactly how it will be once I get some infrastructure in place. The main difference will probably be that you must be in area select mode in order to have access to those particular context menus. That or I might just have a main context menu with sub menus which contain the options.
2) Elevation is currently not copied since I still have work to do to get its grid system in place.
First, I've opened up two maps of the same size (both XL).
Next, we select an area to copy, then right click on the map window and select "copy".
Now, we go to the second map, right click it, and select "paste".
Bam! Now the selected data has been copied to the new map. Don't forget to save your changes!
Lastly, we can open the map in the editor to have a look. Check out the mini map.
A couple notes: 1) The current way copying and pasting portions of a map is done is kind of hacked together, and is not exactly how it will be once I get some infrastructure in place. The main difference will probably be that you must be in area select mode in order to have access to those particular context menus. That or I might just have a main context menu with sub menus which contain the options.
2) Elevation is currently not copied since I still have work to do to get its grid system in place.
Re: Heroes 4 Map Generator / Utility
While this is one of my anticipated features, I do have a wish, I hope you can make possible. I see that the area is copied to the exact same spot on the new map (rows and columns).
Is it possible to decide a different 'starting spot' or simply move the selected area to the desired point? (say you wanted something to be moved from lower left corner to upper right).
And how about copying between levels?
Is it possible to decide a different 'starting spot' or simply move the selected area to the desired point? (say you wanted something to be moved from lower left corner to upper right).
And how about copying between levels?
I'm silent in seven languages - and I got all my familys fear.
Everytime you throw dirt, you loose a little ground
Everytime you throw dirt, you loose a little ground
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: Heroes 4 Map Generator / Utility
Being able to move a selected area is definitely on my list of options to implement here
My thoughts are these: When selecting an area, there will also be a "Move" option, which will move all objects, terrain, and elevation to your next mouse click (an outline of the selected area will follow your mouse cursor around until you click). When pasting to another map, the selected area outline should also be copied to the selection overlay for the new map. That way, you can simply right click again and select the "Move" option.
When moving a selected area, I'm thinking about setting the terrain in the selected area to the default "grass dry" terrain.
As far as copying between levels, I didn't test it, but it should already be working. The H4MG will copy to whatever map / level you are looking at (if they are the same size).
My thoughts are these: When selecting an area, there will also be a "Move" option, which will move all objects, terrain, and elevation to your next mouse click (an outline of the selected area will follow your mouse cursor around until you click). When pasting to another map, the selected area outline should also be copied to the selection overlay for the new map. That way, you can simply right click again and select the "Move" option.
When moving a selected area, I'm thinking about setting the terrain in the selected area to the default "grass dry" terrain.
As far as copying between levels, I didn't test it, but it should already be working. The H4MG will copy to whatever map / level you are looking at (if they are the same size).
Re: Heroes 4 Map Generator / Utility
What effect will this have 'When moving a selected area, I'm thinking about setting the terrain in the selected area to the default "grass dry" terrain', if the copied terrain is included in the 'move option'?
I'm silent in seven languages - and I got all my familys fear.
Everytime you throw dirt, you loose a little ground
Everytime you throw dirt, you loose a little ground
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: Heroes 4 Map Generator / Utility
Not quite sure what you mean, but I also realize I didn't word things as well as I could have. Here's an example:
I select a particular area on the map, then select the move option. Now I can move the selected area anywhere I want. Once I mouse click to drop the selection in its new place, the terrain in old place would be set back to grass dry terrain.
If the old area and new area overlap, the old area terrain would first be set to grass dry, and then the new area would be set to whatever was moved to the new location. Does that make sense / answer your question?
I was also thinking about when pasting to another map (or the same map) to first draw the selected area (the white dashed line) as if you were doing a move, and only paste the copied portion of the map once the mouse is clicked.
I select a particular area on the map, then select the move option. Now I can move the selected area anywhere I want. Once I mouse click to drop the selection in its new place, the terrain in old place would be set back to grass dry terrain.
If the old area and new area overlap, the old area terrain would first be set to grass dry, and then the new area would be set to whatever was moved to the new location. Does that make sense / answer your question?
I was also thinking about when pasting to another map (or the same map) to first draw the selected area (the white dashed line) as if you were doing a move, and only paste the copied portion of the map once the mouse is clicked.
Re: Heroes 4 Map Generator / Utility
Ha, a recipe for confusion: Not being sure about what I wasn't sure about
But yes, you answered it - the old area.
The overlap seems to be a good idea.
But yes, you answered it - the old area.
The overlap seems to be a good idea.
I'm silent in seven languages - and I got all my familys fear.
Everytime you throw dirt, you loose a little ground
Everytime you throw dirt, you loose a little ground
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: Heroes 4 Map Generator / Utility
It's been a little while since I've posted here! I just wanted to post a small update on my progress: I did a little work today on the copy / paste / move for the selected area on a map. I believe I have a good algorithm coded for going between maps of different sizes, as well as just moving objects and terrain in general.
I should have something more to show here relatively soon.
I should have something more to show here relatively soon.
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: Heroes 4 Map Generator / Utility
Alright, I believe I have the move / copy / paste selected areas on a map / between maps working. I think I only have one more task here to finish, which is making the selected area resize itself when switching between maps of different sizes, but the actual copying / moving of objects and terrain seems to be working properly.
I'll try to either get some screen shots or put together a video to showcase this once I get the last task finished.
I'll try to either get some screen shots or put together a video to showcase this once I get the last task finished.
Re: Heroes 4 Map Generator / Utility
That will be a very useful feature. Looking forward to see it in action
I'm silent in seven languages - and I got all my familys fear.
Everytime you throw dirt, you loose a little ground
Everytime you throw dirt, you loose a little ground
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: Heroes 4 Map Generator / Utility
Just a minor update: I'm still working on resizing the selected area outline when copying / pasting between maps of different sizes, but I'm pretty close to having the code setup for this. I just have a little more work to do with the value I'm getting from the arctangent function (need to determine which quadrant each coordinate is in). I'm hopeful that's the main bug I need to fix for this for it to be finished
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: Heroes 4 Map Generator / Utility
Good news, it appears not adjusting the return value of the arctangent function for the quadrant the coordinate was in was indeed the main bug. I have the selected area resizing properly when copying from a small map to an XL map. I just need to get the correct scale factors in place for each of the possible size change combinations, then I think this feature is good to go.
Re: Heroes 4 Map Generator / Utility
So will it automatically scale up to match a XL map if copied from a small? Just thinking, what if I just want to incorporate the same area from small map to larger, but same scale?
I'm silent in seven languages - and I got all my familys fear.
Everytime you throw dirt, you loose a little ground
Everytime you throw dirt, you loose a little ground
- iLiVeInAbOx05
- Equilibris Team
- Posts: 788
- Joined: 21 Jul 2014
Re: Heroes 4 Map Generator / Utility
So what I am referring to when I talk about scaling up or down is the white dashed outline of the selected area. The rows and columns for objects and terrain won't be scaled by default.
For example, say I draw an outline of a larger area on a small map and select copy. I then switch to an XL map and select paste. The white dashed outline will appear and follow your mouse cursor until you click, but it should be much smaller on the XL map than it was on the small map. So I scale the white dashed outline to be smaller and correctly display where the objects and terrain will be pasted.
I've got the scale factors figured out to go from a small map to the other sizes and from an XL map to the other sizes, so there are just medium and large map scale factors to get figured out
For example, say I draw an outline of a larger area on a small map and select copy. I then switch to an XL map and select paste. The white dashed outline will appear and follow your mouse cursor until you click, but it should be much smaller on the XL map than it was on the small map. So I scale the white dashed outline to be smaller and correctly display where the objects and terrain will be pasted.
I've got the scale factors figured out to go from a small map to the other sizes and from an XL map to the other sizes, so there are just medium and large map scale factors to get figured out
Last edited by Anonymous on 21 Sep 2016, 15:04, edited 1 time in total.
Who is online
Users browsing this forum: No registered users and 1 guest