CorsixTH Forums

Community => Hospital Café => Topic started by: snowblind on February 28, 2013, 08:10:43 PM

Title: Level editor updated 15Oct 2013
Post by: snowblind on February 28, 2013, 08:10:43 PM
hello everyone, koanxd here with a new name!

Because I love this project and I love to make custom levels in any game, I've put some work into making a GUI level editor. Using notepad to edit .level files was getting a bit tedious and error-prone.

However you should know this is my first application to have any practical use. I pretty much started it to learn java and to test myself. It has helped me alot but I also want it to help you!  ;)

Included in the zip are a runnable .jar and .exe file. You will need Java Runtime Environment installed to run it.

Please always backup your level files before using the program and report any errors you find! Any help or suggestions are welcome.

**known issues**
 * it should not be possible to choose non-existent diseases for an emergency.

 **future improvements**
 * give warning when there is no way a disease can be cured. (because the rooms don't exist)
 * multilingual support (priority: disease names)
 * error handling
 * option to reset each value to default individually
 * should only ask for saving changes on exit if changes have been made.
 * missing values: some awards, salaryAbilityDivisor, ResearchPointsDivisor, epidemics-related, maxDiagDiff, holdVisual, mayor frequency, training-related, object cost, room cost, disease price.. (maybe not all of them should be included.)

**testing required**
 * why do the sam files have values other than 0 or 1 for #visuals / #non_visuals? does it affect the frequency of each disease? is it implemented in CTH yet?
Title: Re: Level editor v0.1
Post by: mrtnptrs on February 28, 2013, 08:20:24 PM
It looks very nice! Well done!

Maybe we could add this programm to version 0.30 or we could make a kind of development tool of this and put it on the Google Code page?

But before that you could maybe change the logo of the exe? It now shows the Java logo. Maybe you could add the CorsixTH logo?

The Briefing, at the General screen, is also not showed correctly. This is of course because this is all put one one single string at the .level-file and the programm doesn't understand this.
Title: Re: Level editor v0.1
Post by: Lego3 on February 28, 2013, 08:48:27 PM
Very very nice indeed! :-D

This will make the threshold for starting to create maps incredibly much lower. :-)

As Maarten suggests you are indeed welcome to use our icon if you want to. :-) Maybe the MapEditor icon is the most relevant one? We could also possibly ask Wolter to make yet another icon...

A small but very effective thing to change is the Look & Feel: http://docs.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html (http://docs.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html) :-) So that it selects a look & feel based on which operating system you are on.
Title: Re: Level editor v0.1
Post by: snowblind on February 28, 2013, 10:44:55 PM
Thanks, if there is an easy way to make it less ugly i'll look into it.  :D And an icon too, sure.

Maybe we could add this programm to version 0.30 or we could make a kind of development tool of this and put it on the Google Code page?
I don't mind really, but shouldn't it be tested first? I don't know how the game reads level files, for example. There could be some errors.. Or is that the point of adding it to the project?

Also, I don't see anything wrong with the briefing. I've made it impossible to put a newline, so it should work correctly, right?
Title: Re: Level editor v0.1
Post by: Grimdoc on February 28, 2013, 10:49:47 PM
Great! :)

I haven't tested it, just looked at the GUI, but it should be much easier for new users (or less PC skilled people) to make a new map with this tool!
Title: Re: Level editor v0.1
Post by: mrtnptrs on March 01, 2013, 11:54:56 AM
Thanks, if there is an easy way to make it less ugly i'll look into it.  :D And an icon too, sure.

Maybe we could add this programm to version 0.30 or we could make a kind of development tool of this and put it on the Google Code page?
I don't mind really, but shouldn't it be tested first? I don't know how the game reads level files, for example. There could be some errors.. Or is that the point of adding it to the project?

Also, I don't see anything wrong with the briefing. I've made it impossible to put a newline, so it should work correctly, right?

Yes, first it needs to be tested by developers.
Title: Re: Level editor v0.1.1
Post by: snowblind on March 01, 2013, 03:03:55 PM
v0.1.1
- the app now changes appereance depending on your OS.
- added an icon
- fixed a bug that would not allow a negative balance as lose criteria.

The game and map editor don't show any icon for me.. so I used Wolter's icon from the forum.

The zip is now too big for an attachment so I use mediafire.
Title: Re: Level editor v0.1.1
Post by: mrtnptrs on March 01, 2013, 04:37:12 PM
It works great and looks much nicer now! Well done! :)

But maybe you can add a message when loading of a level file failed, because it is for example a .map-file instead of a .level-file. Now the programm reverts automaticly to the example map and there's no message.
Title: Re: Level editor v0.1.1
Post by: snowblind on March 01, 2013, 08:42:09 PM
hmm.. but on the open dialog it will only show you level files by default. Only if you change it to "all files", unexpected things could happen. It really only makes sense to load .level and .sam files, but the latter is not fully supported yet. Maybe there should be a warning.
Title: Re: Level editor v0.1.1
Post by: Lego3 on March 02, 2013, 07:44:59 AM
There should be a way to remove the "all files" filter I think.
Title: Re: Level editor v0.12
Post by: snowblind on March 03, 2013, 06:51:58 PM
You're right, thanks =)

v0.12
- only .level and .sam files can be opened now
- fix: could not load start_staff
- fix: could not edit win % on emergencies
- added a warning when the population growth is never stopped.
Title: Re: Level editor v0.12
Post by: mrtnptrs on March 04, 2013, 02:47:31 PM
You're right, thanks =)

v0.12
- only .level and .sam files can be opened now
- fix: could not load start_staff
- fix: could not edit win % on emergencies
- added a warning when the population growth is never stopped.

The compatibility with .SAM-files is not so good at the moment, but we know you're working on it! :)
But it now seems that startup the program is much slower then it was before. I will dubble-check this tonight.

Edit: I checked this at home and I think I was wrong. Does it start by you as fast as with earlier versions?
Title: Re: Level editor v0.12
Post by: snowblind on March 05, 2013, 09:44:00 AM
Not sure, I think it's the same. It seem quite slow for such a small program.. but fast enough for me not to care about it.

btw: does any of the developers have an answer to this?
Quote
* why do the sam files have values other than 0 or 1 for #visuals / #non_visuals? does it affect the frequency of each disease? is it implemented in CTH yet?
Title: Re: Level editor v0.12
Post by: MarkL on March 05, 2013, 12:32:21 PM
I don't think #visuals / #non_visuals are used yet and I think the numbers relate to the month that type can first appear in the hospital.  A good one to check this against is Alien DNA as that does not show up until about the fourth year in some levels.
Title: Re: Level editor v0.12
Post by: MarkL on March 05, 2013, 02:44:22 PM
I was wondering why there is a box to enter month for some and not others? 

Where does it get this from and how can you add a box when one is not there?
Title: Re: Level editor v0.12
Post by: L_konings on March 06, 2013, 09:31:24 AM
Wow great that you wrote a program who can create the individual notepad files.
Is it possible to randomize the amount of staff available each month?

 
Title: Re: Level editor v0.12
Post by: Lego3 on March 06, 2013, 09:58:56 AM
Two small user experience notes:

* When I save a new file and the filter is set to *.level files I should not need to write a new name like "testing.level" The dialog should check if I have added the ending myself, otherwise it append .level to my chosen name.

* Would it be easy to add one or two newlines between each category when exporting? That way the .level file would be a lot easier to read if you for some strange reason still want to look at it in a text editor despite this fantastic initiative. :-)
Title: Re: Level editor v0.12
Post by: alanwoolley on March 06, 2013, 04:53:21 PM
This looks really cool. Like mrtnptrs has said, I'd like to see this Google Code / GitHub / Bitbucket or similar so that other people can contribute easily.
Title: Re: Level editor v0.12
Post by: mrtnptrs on March 06, 2013, 05:12:37 PM
This looks really cool. Like mrtnptrs has said, I'd like to see this Google Code / GitHub / Bitbucket or similar so that other people can contribute easily.
Maybe we could just add this to our source code of CorsixTH in a seperate folder? Like we've did with the source code of the Map editor.
Title: Re: Level editor v0.12
Post by: alanwoolley on March 06, 2013, 06:20:33 PM
Maybe we could just add this to our source code of CorsixTH in a seperate folder? Like we've did with the source code of the Map editor.

I don't see why not, although the map editor is a bit different in that it requires the CTH engine and resources to function IIRC. This would be different in that it's stand-alone and if it was in a separate repository you could check it out without having to checkout the entire CTH project. Depends on what everyone would see as being more convenient and easier to manage I suppose.

Either way, I've got my eye on this because I'm a reasonable Java programmer and it looks like I could offer something here.
Title: Re: Level editor v0.12
Post by: mrtnptrs on March 06, 2013, 07:48:08 PM
Maybe we could just add this to our source code of CorsixTH in a seperate folder? Like we've did with the source code of the Map editor.

I don't see why not, although the map editor is a bit different in that it requires the CTH engine and resources to function IIRC. This would be different in that it's stand-alone and if it was in a separate repository you could check it out without having to checkout the entire CTH project. Depends on what everyone would see as being more convenient and easier to manage I suppose.

Either way, I've got my eye on this because I'm a reasonable Java programmer and it looks like I could offer something here.

OK? But then we could add this to the trunk when it is more stable?
Title: Re: Level editor v0.12
Post by: Grimdoc on March 06, 2013, 07:57:03 PM
I think it would be great to have this packaged with CTH, if the programmer does consent.

What you could add:
- An "About" tab on the top, that tells you the version of the level editor, and who made it.
- On the "objects" tab, should there be a max level for object strength? If there is a max strength in CTH.
- Maybe set all the diseases to be checked (available) by default when you make a new map?
- Is it possible that the level editor remember where where I last loaded a file from after a restart of the program?
And maybe the standard start location could be set directly to the level folder (if this program is packed together with CTH).

PS: I love that you easily can add staff from the start with this tool!
Again, great work!
Title: Re: Level editor v0.12
Post by: mrtnptrs on March 06, 2013, 08:50:14 PM
I think it would be great to have this packaged with CTH, if the programmer does consent.

What you could add:
- An "About" tab on the top, that tells you the version of the level editor, and who made it.
- On the "objects" tab, should there be a max level for object strength? If there is a max strength in CTH.
- Maybe set all the diseases to be checked (available) by default when you make a new map?
- Is it possible that the level editor remember where where I last loaded a file from after a restart of the program?
And maybe the standard start location could be set directly to the level folder (if this program is packed together with CTH).

PS: I love that you easily can add staff from the start with this tool!
Again, great work!

I totally agree with what you're said! You're doing well snowblind!
Title: Re: Level editor v0.12
Post by: alanwoolley on March 06, 2013, 11:24:37 PM

OK? But then we could add this to the trunk when it is more stable?

Sure, or perhaps just include it in the snapshot or the releases so it's not duplicated. It's not important anyway, so long as it's readily accessible somewhere for people to contribute. I'm just throwing some ideas out there.

Again, this is assuming snowblind would be happy with it being made available in this way.
Title: Re: Level editor v0.12
Post by: snowblind on March 07, 2013, 01:35:51 AM
@MarkL: #visuals and #non_visuals define whether a disease is available or not. You are thinking about #visuals_available, which also explains your question: there is no #non_visuals_available, at least not until the developers decide to add it, which I would approve of. =)

@L_konings: Now that's probably a matter of preference, but yea I could randomize it abit.

@Lego3: I agree, those are already on my list in the first post.

@Grimdoc: consider them done.

@alanwoolley: I don't mind adding it to the project, I don't know how though..

I'll probably release a new version tomorrow.
Title: Re: Level editor v0.12
Post by: snowblind on March 07, 2013, 07:14:41 PM
v0.13
- fix: can no longer save file without file extension.
- fix: on exit -> save -> cancel, the program does not close anymore.
- can now edit #bound property of lose criteria
- made the output file more readable
- remember the last directory when opening/saving a file.
- slightly randomized staff distribution
- made all diseases existent by default.
- machine strength now has a limit of 99.
- added an "about" tab
- corrected tool tip description of interest rate (it used to say "monthly payment")
Title: Re: Level editor v0.13
Post by: Lego3 on March 08, 2013, 07:12:19 AM
When it comes to machine strength research there is a cap of, if I remember correctly, 20 because that's the cap TH had to my knowledge. That said we could also make that a level file specific value with a default of 20...
Title: Re: Level editor v0.13
Post by: snowblind on March 08, 2013, 11:06:48 AM
I thought it already is level specific? Is it not possible to set #gbv.MaxObjectStrength higher than 20?
Title: Re: Level editor v0.13
Post by: L_konings on March 08, 2013, 03:39:54 PM
Will it be possible in the future to translate the strings used in this program? This to encourage non english speaking modders to create .level files.

Title: Re: Level editor v0.13
Post by: snowblind on March 08, 2013, 04:26:00 PM
It might be possible in the future, however it would need some re-writing to provide a basis for translaters. I think disease names should be adressed first. For the rest, you can at least look it up on a dictionary.
Title: Re: Level editor v0.13
Post by: mrtnptrs on March 08, 2013, 06:01:41 PM
I also would really like this to be translateble! :) But for the rest the application runs well on my computer system.
Title: Re: Level editor v0.13
Post by: Lego3 on March 09, 2013, 07:45:37 AM
Indeed, it might be that we use maxobjstrength. My graphics card has died so I'm having a hard time checking or doing anything with CorsixTH at the moment. Checking here via my phone. We could add this to our transifex translation project. I'd say we add it to trunk in its own folder if snowblind agrees to use the MIT license? Then we need some place (like this thread, or a new board) where people can write ifnthey intend to change something. Otherwise there will probably be double work carried out. You've done the hard work here snowblind, do you think it's ok that people start contributing and changing in your code?
Title: Re: Level editor v0.13
Post by: mrtnptrs on March 09, 2013, 09:26:56 AM
Indeed, it might be that we use maxobjstrength. My graphics card has died so I'm having a hard time checking or doing anything with CorsixTH at the moment. Checking here via my phone. We could add this to our transifex translation project. I'd say we add it to trunk in its own folder if snowblind agrees to use the MIT license? Then we need some place (like this thread, or a new board) where people can write ifnthey intend to change something. Otherwise there will probably be double work carried out. You've done the hard work here snowblind, do you think it's ok that people start contributing and changing in your code?
First you PC crashed and now you have a new computer the video card died, how much luck can you have?! ;)
But these ideas sounds good to me.
Title: Re: Level editor v0.13
Post by: snowblind on March 09, 2013, 03:30:48 PM
Sounds good to me, too! MIT license is fine, yes. I'll need some guidance on how to use googleCode, though.

Anyone who wants to contribute will be a great help! Though I'm really a newbie at programming, so the code might not be cut out for group work. If so then perhaps the code structure can still be changed. If you encounter any mysteries, just ask me to explain whatever I was thinking there.  ;)

I think we can use this thread first to post who is working on what, and I'll keep the list updated in the first post.
Title: Re: Level editor v0.13
Post by: Lego3 on March 09, 2013, 04:56:14 PM
Indeed, it might be that we use maxobjstrength. My graphics card has died so I'm having a hard time checking or doing anything with CorsixTH at the moment. Checking here via my phone. We could add this to our transifex translation project. I'd say we add it to trunk in its own folder if snowblind agrees to use the MIT license? Then we need some place (like this thread, or a new board) where people can write ifnthey intend to change something. Otherwise there will probably be double work carried out. You've done the hard work here snowblind, do you think it's ok that people start contributing and changing in your code?
First you PC crashed and now you have a new computer the video card died, how much luck can you have?! ;)
But these ideas sounds good to me.

Well, the really unlucky part was my laptop completely dying in december, since it was not even 2 years old... This time it was the graphics card of my desktop though, which is over 5 years old, and the card has always been quite hot, so that's not as strange that something gets broken. I bought a new card today, and because of all the time that has gone by I could get a card that: 1. costs a third of what the old one cost (not even counting inflation) 2. Draws half the power of my old card 3. Is not nearly as hot during normal work 4. Doesn't sound so loud when under high load and finally 5. is a little better than the old card. So I'm also a little happy actually. :-)
Title: Re: Level editor v0.13
Post by: Lego3 on March 09, 2013, 04:58:11 PM
So, back to the actual topic:

snowblind: Do you have any pending changes locally at the moment? Could you send me a pm or write in this thread your e-mail so I can allow you to commit to the repository? If you don't have more changes locally I can create the folder in the repository and give you a walkthrough how to work with SVN. :-)
Title: Re: Level editor v0.13
Post by: mrtnptrs on March 09, 2013, 05:29:48 PM
Indeed, it might be that we use maxobjstrength. My graphics card has died so I'm having a hard time checking or doing anything with CorsixTH at the moment. Checking here via my phone. We could add this to our transifex translation project. I'd say we add it to trunk in its own folder if snowblind agrees to use the MIT license? Then we need some place (like this thread, or a new board) where people can write ifnthey intend to change something. Otherwise there will probably be double work carried out. You've done the hard work here snowblind, do you think it's ok that people start contributing and changing in your code?
First you PC crashed and now you have a new computer the video card died, how much luck can you have?! ;)
But these ideas sounds good to me.

Well, the really unlucky part was my laptop completely dying in december, since it was not even 2 years old... This time it was the graphics card of my desktop though, which is over 5 years old, and the card has always been quite hot, so that's not as strange that something gets broken. I bought a new card today, and because of all the time that has gone by I could get a card that: 1. costs a third of what the old one cost (not even counting inflation) 2. Draws half the power of my old card 3. Is not nearly as hot during normal work 4. Doesn't sound so loud when under high load and finally 5. is a little better than the old card. So I'm also a little happy actually. :-)

Ok, then nothings wrong anymore! :) And maybe this is a good tip: remove all the dust in your desktop. Then you can be sure the graphics card won't be hot anymore!

But snowblind, you can also ask me a question about SVN if you want! :)
Title: Re: Level editor v0.13
Post by: snowblind on March 10, 2013, 07:17:51 PM
Lego, you've got mail!

Hmm so far I know how to SVN checkout, I even succeeded to compile the game once =D

Is it possible for more than one to work on the same file or how does it work?

Btw I haven't done any work since 0.13.
Title: Re: Level editor v0.13
Post by: Lego3 on March 10, 2013, 08:09:52 PM
You do your work locally, then at some point you decide to commit your changes to the central repository.

If someone else has made changes to the same file as you in the meantime, but in different places inside it you just need to update your copy (it will automatically merge the changes) and can then commit your changes. If you have both made changes at the same place in the file you will first have to resolve that conflict by looking at the two files side by side and decide which one to use.

Now when I add your files you will have to checkout or update your copy and start using that location as your starting point for additional development.
Title: Re: Level editor v0.13
Post by: snowblind on March 11, 2013, 04:59:18 PM
Thanks for your help! Though I'm not sure about a few things yet.

I usually download the latest prebuilt SVN snapshot of the game which is ready to play with the exe, without needing to compile it. Is the prebuilt version created manually with each new revision? And should levelEdit be included in the prebuilt version then, like mapEdit?

Also, does it make any sense to include the eclipse project? I was just not sure if it's needed so I put it there.. =)
Title: Re: Level editor v0.13
Post by: Lego3 on March 11, 2013, 05:32:02 PM
Since eclipse is cross plattform anyway, and there are no additional dependencies, I thought it could as well be there. If you have another IDE or don't use any it's very easy to use the source code files anyway.

The prebuilt version is done automatically on each commit to the repository. We could include LevelEdit there too I presume, but I think we should try it out for a while first to see if we find any serious bugs. :-)
Title: Re: Level editor v0.13
Post by: mrtnptrs on March 11, 2013, 06:40:10 PM
Since eclipse is cross plattform anyway, and there are no additional dependencies, I thought it could as well be there. If you have another IDE or don't use any it's very easy to use the source code files anyway.

The prebuilt version is done automatically on each commit to the repository. We could include LevelEdit there too I presume, but I think we should try it out for a while first to see if we find any serious bugs. :-)

I think you could add this program as a pre-build-version (with .exe) to the OpenGL version in one of the comming weeks. You're doing well guys!
Title: Re: Level editor v0.13
Post by: L_konings on March 12, 2013, 11:00:19 PM
Offtopic

-Is it a good idea to make a topic about how to make a realistic .level file? That we share some tips to make us become better in creating these files. Cause I am asking myself if it would be fun to extend the original campaign with a few more maps/missions that have higher challenges etc. In the end you want to create good .level files with this tool youve created. It would be a pity if the tool is available but the .level files are with stupid values.
Title: Re: Level editor v0.13
Post by: snowblind on March 13, 2013, 11:15:11 AM
L_konings: You can open a topic and find out! The default values are usually a good starting point. You can try to look at the original level files of Theme Hospital too, but they may not load correctly yet. I'll try to add full support for them. What I'm having problems with is to give a balanced population growth.

Also, rather than extending the original campaign, I think we should at some point provide a corsixTH campaign, since the goal is to be independent of the original game files eventually, right?

Lego3: I don't mind, I will still update the download link here when there have been major changes then.

started: compatibility with .SAM files.
Title: Re: Level editor v0.13
Post by: Grimdoc on March 13, 2013, 03:28:46 PM
Also, rather than extending the original campaign, I think we should at some point provide a corsixTH campaign, since the goal is to be independent of the original game files eventually, right?
Yes. This is the idea.

But right now we don't have any ability to "link" levels together to make a campaign.
And we need own levels for a campaign (maybe be based on the idea of the original ones?).

At some time, I hope players can make custom campaigns as well.
Title: Re: Level editor v0.14
Post by: snowblind on March 29, 2013, 12:46:28 AM
version 0.14
- Fix: added training-related values when saving a file. without this, there would be an error whenever you try to build a training room.
- Fixed some tooltips: "How much research is required to improve new ItemListener() drug"..
- I decided not to add full support for SAM-files. It was getting too fuzzy.
- Instead, there is a warning when you try to open anything but a level-file.

so, most importantly, if you made a new level recently, open and save the file again so you can have a training room!

I might take a break from this now unless there are any more bugs.
Title: Re: Level editor v0.14
Post by: MarkL on April 11, 2013, 02:19:05 PM
I have asked this before and can't see any reply.

Is there a reason why some boxes seem to be missing.  Look at the picture Elvis become available after 3 months and then the rest there is no box there to say when they become available.  It is the same on other tabs, the input box is there for a line sometimes two or three lines and then not the rest.  (Odd thing here is Elvis is unticked so is not available, yet I can enter a number here under month)

What determines whether there should be any input box?
Title: Re: Level editor v0.12
Post by: snowblind on April 11, 2013, 04:34:18 PM
@MarkL: #visuals and #non_visuals define whether a disease is available or not. You are thinking about #visuals_available, which also explains your question: there is no #non_visuals_available, at least not until the developers decide to add it, which I would approve of. =)

So, only visual diseases have that option.
Title: Re: Level editor v0.14
Post by: MarkL on April 11, 2013, 06:04:23 PM
This is where I am confused and hadn't realised you had responded to me.
I don't recall Sleeping Illness, Discrete Itching and Pregnancy being visual, yet they have a box to input when they can first appear.

That said, I do think you are right in saying that the game is not reading that yet, not all of it anyway
Title: Re: Level editor v0.14
Post by: snowblind on April 11, 2013, 07:49:14 PM
They are part of the visuals_available table, there is just no animation for it yet.
Title: Re: Level editor v0.14
Post by: Lego3 on April 12, 2013, 06:27:26 AM
They are part of the visuals_available table, there is just no animation for it yet.

for discrete itching and sleeping illness: I think that these two are the ones who frequently scratch and yawn respectively in the hospital.
Title: Re: Level editor v0.14
Post by: MarkL on April 12, 2013, 09:24:46 AM
for discrete itching and sleeping illness: I think that these two are the ones who frequently scratch and yawn respectively in the hospital.

I didn't know we had patients that could scratch, I'll have to lookout for that, if I find that animation I will try and get it added.   :)

I have been looking at the SAM files and can now see that TH treats them as visual, so it is making more sense  to me now.

#visuals[0]      0   I_BLOATY_HEAD
#visuals[1]      0   I_HAIRYITUS
#visuals[2]      0   I_ELVIS
#visuals[3]      0   I_INVIS
#visuals[4]      0   I_RADIATION
#visuals[5]      0   I_SLACK_TONGUE
#visuals[6]      0   I_ALIEN
#visuals[7]      0   I_BROKEN_BONES
#visuals[8]      0   I_BALDNESS
#visuals[9]      0   I_DISCRETE_ITCHING
#visuals[10]   0   I_JELLYITUS
#visuals[11]   0   I_SLEEPING_ILLNESS
#visuals[12]   0   I_PREGNANT
#visuals[13]   0   I_TRANSPARENCY

They are part of the visuals_available table, there is just no animation for it yet.

It would be nice at some point to have the visuals_available being used as I thnk this is where you can delay diseases from appearing until a given month.  Whereas visuals and non_visuals is whether they are available at all in the map and visuals_available (which could be extend to any disease) is to do with "from when" (0 means available immediately).
Title: Re: Level editor v0.12
Post by: MarkL on April 12, 2013, 09:53:33 AM
btw: does any of the developers have an answer to this?
Quote
* why do the sam files have values other than 0 or 1 for #visuals / #non_visuals? does it affect the frequency of each disease? is it implemented in CTH yet?


Starting to understand now - I think - so with level 1 SAM you have this

#visuals[0]      5   I_BLOATY_HEAD
#visuals[3]      3   I_INVIS

#non_visuals[0]      5   I_UNCOMMON_COLD
#non_visuals[6]      4   I_MULTIPLE_TV_PERSONALITIES
#non_visuals[13]   5   I_THE_SQUITS
#non_visuals[16]   5   I_HEAPED_PILES

I suspect that these numbers relate to  how many you will see. So for every 27 patients 5 will be bloaty, 3 invis and 4 TV. So as you said it affects the frequency of each disease or should.  (I don't think this is used in CorsixTH)

It would make more sense to use 1 and 0 (available or not) which I think is what you are doing and CorsixTH.  Tell me if I am wrong though, I am still trying to fully understand all the items in the level files to make better maps.

#visuals_available[3]      3   I_INVIS (I think this is the one that determines it appears from month 3)
Title: Re: Level editor v0.14
Post by: MarkL on April 12, 2013, 06:54:56 PM
I have noticed that there is no provision for the computer names and if you add them manually, the next time you edit the file this information is being removed.

--------------------- Competitor Information -----------------------

| Index in the away "computer" | Is that opponent playing? | 1 is yes, 0 no | Comment |
#computer[12].Playing 1 CORSIX
#computer[13].Playing 1 ROUJIN
#computer[14].Playing 1 EDVIN
Title: Re: Level editor v0.14
Post by: Lego3 on April 13, 2013, 08:40:36 AM
I have noticed that there is no provision for the computer names and if you add them manually, the next time you edit the file this information is being removed.

--------------------- Competitor Information -----------------------

| Index in the away "computer" | Is that opponent playing? | 1 is yes, 0 no | Comment |
#computer[12].Playing 1 CORSIX
#computer[13].Playing 1 ROUJIN
#computer[14].Playing 1 EDVIN

Yes, as you can see there is only one variable here, "Playing", and that is set to "1". CORSIX etc is merely a comment that number 12 corresponds to that competitor name. This is how it was in the original. When we add some kind of AI and start using more variables there we could very well add a name variable too.
Title: Re: Level editor v0.14
Post by: snowblind on April 13, 2013, 11:41:22 AM
I would love to be able to control how many of each disease will appear on the level percentage-wise, or when each disease starts appearing (not only visuals), or even how wealthy the patients are, thus affecting how much they are willing to pay and how many have an insurance..

My wishlist for custom levels is huge actually =D
Title: Re: Level editor v0.14
Post by: MarkL on April 13, 2013, 03:08:27 PM
I have noticed that there is no provision for the computer names and if you add them manually, the next time you edit the file this information is being removed.

--------------------- Competitor Information -----------------------

| Index in the away "computer" | Is that opponent playing? | 1 is yes, 0 no | Comment |
#computer[12].Playing 1 CORSIX
#computer[13].Playing 1 ROUJIN
#computer[14].Playing 1 EDVIN

Yes, as you can see there is only one variable here, "Playing", and that is set to "1". CORSIX etc is merely a comment that number 12 corresponds to that competitor name. This is how it was in the original. When we add some kind of AI and start using more variables there we could very well add a name variable too.

My point was that if you use this editor on your level files you are then the only name to show in the game.
Title: Re: Level editor v0.14
Post by: snowblind on April 13, 2013, 03:46:48 PM
Ohh well does it make a difference in gameplay?
Title: Re: Level editor v0.14
Post by: MarkL on April 13, 2013, 05:37:12 PM
Ohh well does it make a difference in gameplay?

No, but I thought it worth mentioning...
Title: Re: Level editor v0.14
Post by: snowblind on April 14, 2013, 08:32:49 AM
Yea thanks, I'll put it on the todo list. However since it's not an urgent matter I'm a bit lazy to do it now =p
Title: Re: Level editor v0.14
Post by: MarkL on April 15, 2013, 03:29:25 PM
Something else for this todo list you have, I have noticed is that when you use the editor it removes the copyright stuff from the start of the file.
Title: Re: Level editor v0.14
Post by: snowblind on April 18, 2013, 07:54:05 PM
Is that really necessary? because it's now part of the CorsixTH project?
Title: Re: Level editor v0.14
Post by: mrtnptrs on July 07, 2013, 04:21:41 PM
Is that really necessary? because it's now part of the CorsixTH project?

We're releasing the game under the MIT license and then you need to add that copyright text to every file you make, also level files.

Edit: isn't it a good idea to sticky this topic?
Title: Re: Level editor v0.14
Post by: snowblind on July 08, 2013, 06:25:01 PM
hmm I understand that Avatar and the example level have the copyright text because they are part of the software, but the files that are made by this program are not. Am I mistaken?
Title: Re: Level editor v0.14
Post by: MarkL on July 08, 2013, 07:50:52 PM
The way it reads to me in the wiki, this applies to all the files.  Although I don't think you can with the actual maps.

Perhaps we need Peter or Edvin to answer this one.
Title: Re: Level editor v0.14
Post by: Lego3 on July 10, 2013, 08:39:36 PM
When you create something it's up to you to decide if you want it under the MIT license or not. I see now that we don't have that in the Level Editor source files either, but I assume that it's ok with you snowblind to have it under that license? Otherwise we can't have it in the repository.
Title: Re: Level editor v0.14
Post by: snowblind on July 11, 2013, 09:14:05 AM
That's fine, I already agreed to use the license.
Title: Re: Level editor v0.14
Post by: Lego3 on July 11, 2013, 04:42:57 PM
Good, I thought so. :-)
Title: Re: Level editor v0.14
Post by: rossco on August 10, 2013, 06:47:28 PM
hello everyone, koanxd here with a new name!

Because I love this project and I love to make custom levels in any game, I've put some work into making a GUI level editor. Using notepad to edit .level files was getting a bit tedious and error-prone.

However you should know this is my first application to have any practical use. I pretty much started it to learn java and to test myself. It has helped me alot but I also want it to help you!  ;)

Included in the zip are a runnable .jar and .exe file. You will need Java Runtime Environment installed to run it.

Please always backup your level files before using the program and report any errors you find! Any help or suggestions are welcome.

**work in progress**

**known issues**
 * it should not be possible to choose non-existent diseases for an emergency.

 **future improvements**
 * give warning when there is no way a disease can be cured. (because the rooms don't exist)
 * multilingual support (priority: disease names)
 * error handling
 * option to reset each value to default individually
 * should only ask for saving changes on exit if changes have been made.
 * competitor options
 * missing values: some awards, salaryAbilityDivisor, ResearchPointsDivisor, epidemics-related, maxDiagDiff, holdVisual, mayor frequency, training-related, object cost, room cost, disesase price.. (maybe not all of them should be included.)

**testing required**
 * why do the sam files have values other than 0 or 1 for #visuals / #non_visuals? does it affect the frequency of each disease? is it implemented in CTH yet?

source code (http://code.google.com/p/corsix-th/source/browse/trunk#trunk%2FLevelEdit)





this is epic how do u program this stuff ???
Title: Re: Level editor v0.14
Post by: snowblind on August 15, 2013, 05:54:42 PM
this is epic how do u program this stuff ???
well I taught myself the basics of Java, there are lots of tutorials for it, even youtube tutorials which I find much easier to follow than books for example.. Once you know the basics and you feel that programming might be a thing for you, You can start a little project like I did here. Whenever you don't know how to implement something, just google it. Without google there's really no way I could have done this.

By the way, I've currently stopped working on this but if anyone has suggestions or finds a bug, just post here and I might get motivated to do something again!
Title: Re: Level editor v0.14
Post by: mrtnptrs on September 08, 2013, 12:03:46 AM
Looks like Jorgen has improved some things regarding LevelEdit: http://code.google.com/p/corsix-th/source/detail?r=2468. (http://code.google.com/p/corsix-th/source/detail?r=2468.) But should the version number now be 0.15 or something?
Title: Re: Level editor v0.14
Post by: MarkL on September 08, 2013, 07:57:51 PM
Looks like Jorgen has improved some things regarding LevelEdit: http://code.google.com/p/corsix-th/source/detail?r=2468. (http://code.google.com/p/corsix-th/source/detail?r=2468.) But should the version number now be 0.15 or something?

Odd, it looked like it was Edvin when I looked at the changes
Title: Re: Level editor v0.14
Post by: Lego3 on September 09, 2013, 03:59:01 PM
Looks like Jorgen has improved some things regarding LevelEdit: http://code.google.com/p/corsix-th/source/detail?r=2468. (http://code.google.com/p/corsix-th/source/detail?r=2468.) But should the version number now be 0.15 or something?

We haven't released the Level Editor in any bundle yet, so there's not much point in increasing the numbers yet, especially since my changes were just refactoring.
Title: Re: Level editor v0.14
Post by: snowblind on October 03, 2013, 11:14:00 PM
Update: The leveleditor will not print "empty" win/lose criteria (0 0 0 0 0) anymore. Thanks to MarkL for pointing this out. I didn't know it was an issue.

And good to hear you had some "fun", I thought my code was too horrible to even look at. xD I appreciate it.
Title: Re: Level editor 15 October 2013
Post by: snowblind on October 15, 2013, 07:07:47 PM
I fixed another bug in the latest version. If you had a researcher teaching in the training room, you'd always get an error.

This error will not be fixed unless you update to the new editor, open your level and save it again. I decided to upload it before version 0.30 of the game is released. I have attached it to the first post in this thread.

Alternatively, you can open your level file in a text editor and simply add the following line:
Code: [Select]
#gbv.AbilityThreshold[2]  45 Researcher