OpenXcom Forum

Modding => Work In Progress => Topic started by: Hobbes on June 16, 2014, 03:47:42 am

Title: Map Modding Questions
Post by: Hobbes on June 16, 2014, 03:47:42 am
Well I guess I'm back to modding XCom after finally trying OpenXcom :)

I already got how Rulesets work but I have a few questions regarding the original game's limits regarding maps:

1) Does the original limit of MCD entries still apply (256)? If not, what is the new limit?
2) Is it possible to create new rules for map block placement, like 2 N-S roads?
3) Related to the previous, is it possible to have 2 or more maps defined as a N-S and will the game choose randomly between both?
4) What are the height limits?
5) I supposed there's no way for the rulesets to use mapDataSets from both the UFO/TFTD games but might as well ask. Probably the best way is to convert the TFTD mapdatasets to the UFO palette.

And great work to everyone involved. :)
Title: Re: Map Modding Questions
Post by: Warboy1982 on June 16, 2014, 05:52:11 am
welcome back to the fold!

1) new theoretical limit is 2,147,483,647, or 9,223,372,036,854,775,807 if you use the 64-bit builds, practical results may vary.
2) not via ruleset, but we can see about this.
3) yes.
4) see 1)
5) sure it can, the file format isn't any different, the palette will be your only major hurdle here.

and thanks! glad we could rekindle your interest :)
Title: Re: Map Modding Questions
Post by: Hobbes on June 16, 2014, 06:23:38 am
welcome back to the fold!

1) new limit is 2,147,483,647, or 9,223,372,036,854,775,807 if you use the 64-bit builds.

This is great. The main problem right now is that MapView can only present 256 tiles while designing maps but the no MCD entries limit means that the maps with UFOs and XCOM craft can be designed using the 256 limit, which basically means the double of available tiles in the case of UFOs.

Quote
2) not via ruleset, but we can see about this.

It's not a big issue at the moment since I'm not currently planning to do the type of map generation rules that Dawn City had on UFO2000, where there could be more 2 or more parallel roads and dead end roads because that's a lot of work. But if you're thinking about porting TFTD into OXC then you'll need to deal with the different rules that are used for the Port/Island terrains.

Quote
5) sure it can, the file format isn't any different, the palette will be your only major hurdle here.

There's a converter available made by Bomb Bloke that switches the palette on terrain files from UFO to TFTD so that isn't a problem. I already had converted TFTD's Port terrain for UFO before but the main question here is copyright, specially of the images. Since you guys require a full installation of the original game you have that covered, but distributing modified versions that use the original images is always a risk, specially since you are hosting the mods.
Title: Re: Map Modding Questions
Post by: davide on June 16, 2014, 07:52:05 pm
Hi Hobbes

I hope that your help the community will have a lot of new Terrains/Maps to play that you develop for UFO2000 too

From the first moment that I found OpenXCom, I wish an evolution to an hybrid game with TFTD or ,
at  least, import from TFTD some contents starting from the terror missions (Island, Port, Cruise).

My first idea is to convert the TFTD  files .PCK  to the UFO palette.
the new .PCK are total different from the original.
The maps and the other files could be xcopied from legal installation of TFTD 8)

Some terrains on UFO2000 map sites uses the same .PCK (Slum, Railyard, and so on) :P

But I am a true rooky of OX and I am a newbie in game programming therefore i could get some error about it  :-[

An other OX member named Civillian, more more skilled that me, tried to collect already some of your terrains/maps

I hope that you help us to reorganize your original works :D


Title: Re: Map Modding Questions
Post by: Hobbes on June 17, 2014, 06:04:21 am
Hi Hobbes

I hope that your help the community will have a lot of new Terrains/Maps to play that you develop for UFO2000 too

From the first moment that I found OpenXCom, I wish an evolution to an hybrid game with TFTD or ,
at  least, import from TFTD some contents starting from the terror missions (Island, Port, Cruise).

My first idea is to convert the TFTD  files .PCK  to the UFO palette.
the new .PCK are total different from the original.
The maps and the other files could be xcopied from legal installation of TFTD 8)

Some terrains on UFO2000 map sites uses the same .PCK (Slum, Railyard, and so on) :P

But I am a true rooky of OX and I am a newbie in game programming therefore i could get some error about it  :-[

An other OX member named Civillian, more more skilled that me, tried to collect already some of your terrains/maps

I hope that you help us to reorganize your original works :D

Well, if I can help with anything just ask.

My personal advice is to get Notepad++ and read this https://www.ufopaedia.org/index.php?title=Rulesets_(OpenXcom) page (https://www.ufopaedia.org/index.php?title=Rulesets_(OpenXcom) page) before trying to edit the ruleset files. Took me a while before I managed to add Mad City due to the CTDs but I've done it following the instructions. The coding has a few kinks but the more I do it, the better I'll get :)
Title: Re: Map Modding Questions
Post by: davide on June 17, 2014, 08:03:42 am
This is great. The main problem right now is that MapView can only present 256 tiles while designing maps but the no MCD entries limit means that the maps with UFOs and XCOM craft can be designed using the 256 limit, which basically means the double of available tiles in the case of UFOs.

This is a think that I could try to resolve 8)

I will check in OCX Tools if the issues is open too

Do you see the new tools ?
Title: Re: Map Modding Questions
Post by: Hobbes on June 17, 2014, 06:09:31 pm
This is a think that I could try to resolve 8)

I will check in OCX Tools if the issues is open too

Do you see the new tools ?

I discovered the MCD editor remake, after I found out that the older version didn't work on windows anymore. Any other tools that I should know about?
Title: Re: Map Modding Questions
Post by: davide on June 17, 2014, 07:28:52 pm
I found this long topic, an year old ???

https://openxcom.org/forum/index.php?topic=1321.0 (https://openxcom.org/forum/index.php?topic=1321.0)

and the source code is on

https://github.com/pmprog/OpenXCOM.Tools (https://github.com/pmprog/OpenXCOM.Tools)

I am modding this PCKView to convert the PCK of TFTD

Title: Re: Map Modding Questions
Post by: Hobbes on June 17, 2014, 08:34:47 pm
I found this long topic, an year old ???

https://openxcom.org/forum/index.php?topic=1321.0 (https://openxcom.org/forum/index.php?topic=1321.0)

and the source code is on

https://github.com/pmprog/OpenXCOM.Tools (https://github.com/pmprog/OpenXCOM.Tools)

I am modding this PCKView to convert the PCK of TFTD

I've seen this post but I haven't tried it because progress seems to have stalled.

PCKView can already convert a TFTD's palette: open a TFTD .PCK file, save the individual images as .BMPs, open a UFO .PCK file and load the .BMP files. I'm not sure exactly of the steps but I did something similar when I was converting Port to UFO.

You can also try this: Bomb Bloke's Toolkit (https://www.strategycore.co.uk/files/bbs-toolkit/)
Title: Re: Map Modding Questions
Post by: Hobbes on June 17, 2014, 09:19:04 pm
A few additional questions:

6) Map sizes need to be in multiples of 10 (10x10, 20x20, I'm guessing 30x30 and higher as well) but do they need to be square or can they be rectangular shaped (10x20, etc.)?
7) What is the difference between frequency and MaxCount in the rulesets?
Title: Re: Map Modding Questions
Post by: Aldorn on June 17, 2014, 11:17:30 pm
6) Map sizes need to be in multiples of 10 (10x10, 20x20, I'm guessing 30x30 and higher as well) but do they need to be square or can they be rectangular shaped (10x20, etc.)?
I have definitely no competence in map creation, but your question frightened me, given that I mod some missions to be 50X80 (or 80X50)
What will happen if I decide to mod a 50X80 mission with elements that are 20X10, even 20X20 ?
Title: Re: Map Modding Questions
Post by: Falko on June 17, 2014, 11:37:54 pm
isa there a 30x30 map somewhere ?
i always wanted to test if i could get a 3x3 hangar with space for 4 crafts to work i have a fair idea how to do the geoscape stuff but no idea how to make a base-attack-map :(
Title: Re: Map Modding Questions
Post by: davide on June 18, 2014, 12:00:20 am
I've seen this post but I haven't tried it because progress seems to have stalled.

thanks

i apologize but i do not know previous version of mapview

I use it as a map viewer but i see a lot of features:

(https://i1255.photobucket.com/albums/hh623/davideOX/Mapview_zpsea3058a9.png)

Tiles are limited to 255 as you said in an other post
Title: Re: Map Modding Questions
Post by: Hobbes on June 18, 2014, 12:21:19 am
thanks

i apologize but i do not know previous version of mapview

I use it as a map viewer but i see a lot of features:

Tiles are limited to 255 as you said in an other post

Yup, I use an older version but the funcionalities look the same.

I have definitely no competence in map creation, but your question frightened me, given that I mod some missions to be 50X80 (or 80X50)
What will happen if I decide to mod a 50X80 mission with elements that are 20X10, even 20X20 ?

The side of the Battlescape shouldn't be an issue since the engine most likely arranges the possible map blocks according to the mission defined space. My question has to do with the sizes for the individual map blocks and how they are used during the battlescape generation. Usually the larger blocks (20x20 and bigger) are placed first, in random positions, and afterwards the rest of the free space is filled by the smaller 10x10 blocks. This usually also allows to have rectangular shaped maps but I never tried using 10x20 or bigger with the original game or OXC and I don't know how the engine works exactly.

isa there a 30x30 map somewhere ?
i always wanted to test if i could get a 3x3 hangar with space for 4 crafts to work i have a fair idea how to do the geoscape stuff but no idea how to make a base-attack-map :(

You mean you need a 30x30 map to be used during base defense missions that is capable of holding 4 craft?

Would you also like to have a couple of Skyrangers to be present on the map during the base mission? Although with 4 of them it might get a little crowded... ;)

Title: Re: Map Modding Questions
Post by: Aldorn on June 18, 2014, 12:31:04 am
The side of the Battlescape shouldn't be an issue since the engine most likely arranges the possible map blocks according to the mission defined space. My question has to do with the sizes for the individual map blocks and how they are used during the battlescape generation. Usually the larger blocks (20x20 and bigger) are placed first, in random positions, and afterwards the rest of the free space is filled by the smaller 10x10 blocks. This usually also allows to have rectangular shaped maps but I never tried using 10x20 or bigger with the original game or OXC and I don't know how the engine works exactly.
Thanks for info

EDIT : yes you did it
You mean you need a 30x30 map to be used during base defense missions that is capable of holding 4 craft?

Would you also like to have a couple of Skyrangers to be present on the map during the base mission? Although with 4 of them it might get a little crowded... ;)
Nice job !
Title: Re: Map Modding Questions
Post by: Falko on June 18, 2014, 01:18:18 am
You mean you need a 30x30 map to be used during base defense missions that is capable of holding 4 craft?

Would you also like to have a couple of Skyrangers to be present on the map during the base mission? Although with 4 of them it might get a little crowded... ;)
the default hangar is empty so a bigger one could be empty too :)
i would try my luck with a new hangar mod if i my game has a chance to survive its first base assault (without crash)
Title: Re: Map Modding Questions
Post by: Warboy1982 on June 18, 2014, 04:18:38 am
frequency is the odds of it's occurrence, maxcount is the maximum number of times it can be used.

if maxcount = 3 it has 3/n odds of being picked. if it is picked, the next time it will have 2/n odds.
if frequency = 3 it has 3/n odds of being picked.
Title: Re: Map Modding Questions
Post by: SupSuper on June 18, 2014, 04:32:02 am
the default hangar is empty so a bigger one could be empty too :)
i would try my luck with a new hangar mod if i my game has a chance to survive its first base assault (without crash)
As far as the Baseview is concerned, you can make facilities of any shape and size, although multi-craft hangars might break the sprites.
Title: Re: Map Modding Questions
Post by: Hobbes on June 18, 2014, 04:35:23 am
frequency is the odds of it's occurrence, maxcount is the maximum number of times it can be used.

if maxcount = 3 it has 3/n odds of being picked. if it is picked, the next time it will have 2/n odds.
if frequency = 3 it has 3/n odds of being picked.

Ah ha! Thanks, I'm going to update the wiki with that info.

So if maxcount = 1 then it has 3/1 odds of being picked the first time?
Title: Re: Map Modding Questions
Post by: Warboy1982 on June 18, 2014, 07:01:38 am
if maxcount = 1 it has 1/n chance, where n is the combined total of probabilities for all the map tile types combined

caveat: being used as a landing zone will NOT decrease its usage count, as the maxCount could potentially be less than the total number needed to fit the ufo and the landing craft
Title: Re: Map Modding Questions
Post by: Hobbes on June 18, 2014, 07:09:42 am
if maxcount = 1 it has 1/n chance, where n is the combined total of probabilities for all the map tile types combined

caveat: being used as a landing zone will NOT decrease its usage count, as the maxCount could potentially be less than the total number needed to fit the ufo and the landing craft

Okie dokie, thanks a lot for the explanation.

So, if I'm understanding correctly then you should use either frequency or maxCount but not both?
Title: Re: Map Modding Questions
Post by: Aldorn on June 18, 2014, 05:11:41 pm
Okie dokie, thanks a lot for the explanation.

So, if I'm understanding correctly then you should use either frequency or maxCount but not both?

Hobes, as you are apparently able to make modifications of base , in case you have the time and the desire to do so, there was a request to add a new base facility "Corridor"
https://openxcom.org/forum/index.php?topic=2033.msg20679#msg20679 (https://openxcom.org/forum/index.php?topic=2033.msg20679#msg20679)
Title: Re: Map Modding Questions
Post by: Hobbes on June 18, 2014, 05:34:39 pm
Hobes, as you are apparently able to make modifications of base , in case you have the time and the desire to do so, there was a request to add a new base facility "Corridor"
https://openxcom.org/forum/index.php?topic=2033.msg20679#msg20679 (https://openxcom.org/forum/index.php?topic=2033.msg20679#msg20679)

That design is going raise a few issues: first the human player will take better advantage of it than the aliens. Second, it favors long range sniping, which is another human advantage over the AI.

What I did a while ago, to prevent the chokepoints and force the human player to spread its units around was to redesign the Dirt module used to filling the unbuilt portions of the base so that aliens and XCOM can use it to move.  (see pic below)
Title: Re: Map Modding Questions
Post by: Aldorn on June 18, 2014, 05:40:57 pm
That design is going raise a few issues: first the human player will take better advantage of it than the aliens. Second, it favors long range sniping, which is another human advantage over the AI.

What I did a while ago, to prevent the chokepoints and force the human player to spread its units around was to redesign the Dirt module used to filling the unbuilt portions of the base so that aliens and XCOM can use it to move.  (see pic below)
Thanks once more for contribution !

I guess Moriarty and other will be interested too, could you move it on given topic https://openxcom.org/forum/index.php?topic=2033.msg19652#msg19652 (https://openxcom.org/forum/index.php?topic=2033.msg19652#msg19652)

Then prepare yourself to face other arguing for or against your proposition  ;)

EDIT : original idea was to put some wall with window, like in attached screen shot

Title: Re: Map Modding Questions
Post by: Hobbes on June 18, 2014, 05:58:08 pm
EDIT : original idea was to put some wall with window, like in attached screen shot

Yeah, I read that but there isn't any walls with windows on the XBase tileset so it would be required to design the graphic and add it to a tileset. Which is certainly possible but at the moment I have 50 maps that need their AI route notes to be designed so that I can add those terrains to the terrain pack. I can give assistance but I'm a bit with other priorities at the moment ;)

Title: Re: Map Modding Questions
Post by: Falko on June 19, 2014, 02:14:00 am
You mean you need a 30x30 map to be used during base defense missions that is capable of holding 4 craft?
an empty 30x30 hangar would be fine
at the moment i am stuck (no map modding knowledge :( )

as you can see in the image base image (after the last nightly fix) one can create new facilities with size >2x2
in the second image you see the 4 10x10 hangar map parts are distributed left->right,top->bottom and hangar has 4 not 9 so a lot of dirt is there an a part of the hangar is not reachable (depending on placement)
so i hope my problem gets more understandable
Title: Re: Map Modding Questions
Post by: Hobbes on June 19, 2014, 03:14:50 am
Try the file in attachment it is basically the hangar i posted previously. The thing is that I have no idea how the engine will deal with the .MAP file since it is supposed to automatically create the openings connecting the hangar to the other base modules. Most likely it will require 9 separate 10x10 files the same way that the current hangars are made of 4 10x10 map blocks.

The map block doesn't have any spawn points defined yet so don't expect to see aliens on the hangar.
Title: Re: Map Modding Questions
Post by: Falko on June 19, 2014, 03:27:22 am
thanks
unfortunately with XBASE_21 the complete hangar was replaced with dirt
its not something i really really need right now but some day... i would like to have/make something like that
Title: Re: Map Modding Questions
Post by: Warboy1982 on June 19, 2014, 04:05:08 am
it's been a while since i dabbled in the map generation code, i'd have to look at it to give you proper answers about the maxcount and frequency but i'd say stick with one or the other.
Title: Re: Map Modding Questions
Post by: Hobbes on June 19, 2014, 04:57:19 am
it's been a while since i dabbled in the map generation code, i'd have to look at it to give you proper answers about the maxcount and frequency but i'd say stick with one or the other.

Yeah, that's what sound logical to me since one merely defines the probability of the map block being chosen while the other defines the probability and checks how many times it has been used. Although I suspect it may be possible to create two independent map blocks, if one creates a group of blocks with frequency = 0 and a value on mapCount. I may try this later in the future to see what happens.
Title: Re: Map Modding Questions
Post by: Hobbes on June 19, 2014, 05:11:57 am
thanks
unfortunately with XBASE_21 the complete hangar was replaced with dirt
its not something i really really need right now but some day... i would like to have/make something like that

I just had a look at the facilities section of the XCom1 ruleset and it only has listed X_BASE16 so it will definitely need 9 separate maps and most likely the order for placing them will be:
16 17 18
19 20 21
22 23 24

Which also implies that the Dirt module will have to be renamed X_BASE25 and the corresponding entry updated but I can't find a definition for it on the ruleset, so the alternative is renaming the hangar modules to 21-29. Plus updating the BASEBITS.PCK with graphiocs of these 9 modules.
Title: Re: Map Modding Questions
Post by: Falko on June 19, 2014, 10:14:02 am
after some testing i got a error message that the map height is to high
my hexeditor+wiki (https://www.ufopaedia.org/index.php?title=MAPS) says the map is build for height 4
i changed the 3rd bit and deleted stuff from the map to make it a 2level map but after that it (still) crashed and i suppose without "something" in the RMP file it will not work
Title: Re: Map Modding Questions
Post by: Hobbes on June 19, 2014, 02:59:48 pm
after some testing i got a error message that the map height is to high
my hexeditor+wiki (https://www.ufopaedia.org/index.php?title=MAPS) says the map is build for height 4
i changed the 3rd bit and deleted stuff from the map to make it a 2level map but after that it (still) crashed and i suppose without "something" in the RMP file it will not work

My mistake. The file attached has the right proportions.
Title: Re: Map Modding Questions
Post by: tnarg on June 25, 2014, 03:19:43 pm
Here is a test mod I made It has a 3x3 hanger and a 2x2 lab.  The map files work (they are not that good I only spent 15min making them.)

I can not work out how to get the sprits working in the base screen (geoscape) any help with that would be wellcome.
Title: Re: Map Modding Questions
Post by: Falko on June 25, 2014, 03:35:41 pm
i tried you hangar and it works ! great
to get the sprites correct you need:
Code: [Select]
facilities:
  - type: STR_HANGAR2
    spriteShape: 60
    spriteFacility: 60
extraSprites:
  - type: BASEBITS.PCK
    files:
      60: Resources/bighangar/basebits_09_0.gif
      61: Resources/bighangar/basebits_top_hangar_0.gif
      62: Resources/bighangar/basebits_10_0.gif
      63: Resources/bighangar/basebits_left_hangar_0.gif
      64: Resources/bighangar/basebits_middle_hangar_0.gif
      65: Resources/bighangar/basebits_right_hangar_0.gif
      66: Resources/bighangar/basebits_11_0.gif
      67: Resources/bighangar/basebits_bottom_hangar_0.gif
      68: Resources/bighangar/basebits_12_0.gif
      69: Resources/bighangar/basebits_13_0.gif
      70: Resources/bighangar/basebits_top_corner_0.gif
      71: Resources/bighangar/basebits_14_0.gif
      72: Resources/bighangar/basebits_left_corner_0.gif
      73: Resources/bighangar/basebits_middle_corner_0.gif
      74: Resources/bighangar/basebits_right_corner_0.gif
      75: Resources/bighangar/basebits_15_0.gif
      76: Resources/bighangar/basebits_bottom_corner_0.gif
      77: Resources/bighangar/basebits_16_0.gif
for 2x2 sprites you need 4sprites NE,NW,SE,SW to define the image after this building is complete
and i suppose you could use "spriteShape: 9" for 2x2 facilities [untested]
Title: Re: Map Modding Questions
Post by: tnarg on June 25, 2014, 03:54:01 pm
I saw this ruleset when you posted it before but for some reson it crashes when I enter the base screen and I have not workout out how to fix it.

I'm happy you like my base rule set took me hours to work it out.  So I figgered I'll post it here and save some people time.  You should be able to work out how to add other room.  you can call them what you want just make sure they keep the same ending ie "_01" as that seem to be how they find the other maps for big rooms.
Title: Re: Map Modding Questions
Post by: Falko on June 25, 2014, 04:09:43 pm
the 3x3 size needed some fixes in the code so using a nightly > openxcom_git_master_2014_06_18_2127.zip - built 2014-06-18 19:31 is needed
perhaps that is the reason?
Title: Re: Map Modding Questions
Post by: tnarg on June 25, 2014, 04:18:03 pm
That would be it.  I'm on the Milestone 1.0 vertion.  I'll give this a go tonight.

Thanks
Title: Re: Map Modding Questions
Post by: AlienMuncher on June 26, 2014, 11:41:23 pm
Is it possible guys to put 2 crafts in one hangar with corresponding sprites on the basescape?
Title: Re: Map Modding Questions
Post by: Aldorn on July 31, 2014, 01:56:34 pm
Hi Tnarg,

I worked on your base facilities without your permission...

As I am interested in your work, I decided to integrate them for my own use

I also share it in case it may be of any help to you or any other


I attach the full mod, beware that it does not contain your weapons stuff any more, only facilities



It contains also :
- your maps and routes (as you provided them, i.e. no change)
- resources
   - I renamed your files accordingly to my method  :P and only corrected bottom hangar shape
   - I prepared resources for other facilities
- full ruleset (beware to make all your rulesets converted to UTF8 ; this one has been converted)
- a folder User, that you can use in order to test it easily -> just copy it over your user directory (on a test environment, do not overwrite your own !!)
- included screen shots on folder root are of no use (also just for information)

There is an issue with the 3X3 hangar which does not display well in ufopaedia (see attached screen shot), I have no solution for it

Some advices :
- When designing SpriteFacility (I mean for facilities of size > 1), I meet an issue (I don't know if I am alone) that has something to do with palettes ; it works well for first NW corner, but alters colours (blue-purple only ?) for other sprites ; take care of that when you redesign them, make first a test on one sprite (and please tell me if you meet same issue)
- You also do not have to change SpriteShapes, but SpriteFacilities only (see link below for my comments about building queue shapes)

I posted some information on how making new base facilities here (https://openxcom.org/forum/index.php?topic=2708.msg28270#msg28270)