1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

DoaNE will be soon open source

Discussion in 'Civ4Col - Dawn of A New Era' started by M07, Dec 20, 2015.

  1. M07

    M07 Chieftain

    Joined:
    Mar 29, 2009
    Messages:
    511
    Gender:
    Male
    Location:
    Canada
    Hello everyone,

    I know that a lot of modders asked me a lot to have the source code of DoaNE and we always said no.

    But after the last request of Lib.Spi't, we have reconsider the question and I will make the code open source.

    I will do it in the same time than my release in January.

    We just would like that, if some modders want to modify the DoaNE version, please try to keep the French translation.

    Merry chrismas to all of you ;)
     
  2. Lib.Spi't

    Lib.Spi't Overlord of the Wasteland

    Joined:
    Feb 12, 2009
    Messages:
    3,671
    Location:
    UK
    :clap:

    I think this is the Dawn of a New Era.... of modding...

    Sorry, you know I had to say it!
     
  3. Willi_Tell

    Willi_Tell praefectus praetorio

    Joined:
    Feb 8, 2008
    Messages:
    259
    Location:
    City of the Bears, Switzerland
    Great news! :clap: :woohoo:

    So I'm now dreaming of the day, when the weapon & ammo feature from DoaNE will be implemented in RaRE... :D :crazyeye:
     
  4. Nightinggale

    Nightinggale Chieftain Supporter

    Joined:
    Feb 2, 2009
    Messages:
    3,987
    I see Lib.Spi't once again obstructed my plan. I too planned to bring up this topic once again, but I guess I was too slow :p

    I think it's a great move. The modding community works best with open source where modders from different mods help each other and share code without making the mods identical. The best example of this is likely the Russian translator, who showed up for M:C. He left, but he did make me add Russian support to the DLL. RoM copied my work, expanded on the idea and it now supports all sorts of languages, including some Asian ones. Despite being totally different mods, they shared the same problem with reading text xml files, which mean they can share the code to solve the problem as well. Another reason why open source is important is that it allows bugs to be fixed by anybody, not just the original modder.

    I would dare to say that open source makes DoaNE a real mod. Closed source mods tend to die out and be forgotten a whole lot easier than open source mods and looking at the still active mods (bts and colo), the trend moves towards having a public svn/git server where people can get the newest development version if they like. DoaNE is doing great despite being closed source (so far), but who knows what the future will bring?

    Access to the source code makes me more interested in DoaNE. Being able to play, notice a feature I didn't pay attention to before and have the ability to read the source makes it more interesting than just the gameplay. It also mean if I encounter a bug (unlikely, DoaNE seems pretty stable) I have a chance to look into it myself, which mean a bug report could be "line X should say...". It also unlocks the ability to profile to see if the sourcecode can be made faster, though I wouldn't classify DoaNE as slow (certainly not compared to last release of col2071 :lol:). Open source really brings out a lot of options, but time will tell if I get around to actually use them. It all depends on how hooked I get on the next release and how well M:C can do temporally without me.

    We (the M:C modders) have talked many times about the ability to put multiple types of yields into a single cargo slot. It's an awesome feature, which works very well in DoaNE. I have wanted to copy paste it multiple times, but recently I have reached the conclusion that I wouldn't do that, even if I could because it should be based on a JIT array in M:C. I still wouldn't mind reading the DoaNE code for this, even if I don't plan to copy paste it.

    I see no reason why it should be removed. It would be extra work and it will not restrict non-French speaking modders. Still it's valid to mention as some people come up with the strangest ideas once in a while.

    Not translating new strings due to lack of French skills is a different issue, which could be hard to avoid, but a few untranslated strings can't justify removing the translation. That would be downright silly.
     
  5. M07

    M07 Chieftain

    Joined:
    Mar 29, 2009
    Messages:
    511
    Gender:
    Male
    Location:
    Canada
    Hello guys,

    I am glad to see it makes you happy. :)
    Don't worry, bugs exists in my code. More you develop, more you will have bugs in your project.
    My plan for the next version of DoaNE, was to clean the code and make it faster.
    Even if the mod is not slow, it is for sure perfectible.

    One question, in your team, do you play together or you just play in solo?
     
  6. Lib.Spi't

    Lib.Spi't Overlord of the Wasteland

    Joined:
    Feb 12, 2009
    Messages:
    3,671
    Location:
    UK
    We are spread around all over the place making playing together a tricky issue, the subject has been brought up a few times in the past, but has never come to fruition.

    Would be fun though! :p
     
  7. M07

    M07 Chieftain

    Joined:
    Mar 29, 2009
    Messages:
    511
    Gender:
    Male
    Location:
    Canada
    Arf, it is too bad.

    I would be glad to play with you on the next version of DoaNE. I will let you time to get used to this version, but i think it could be funny.

    I already play with Dazio to DoaNE and it is really great :)
     
  8. Nightinggale

    Nightinggale Chieftain Supporter

    Joined:
    Feb 2, 2009
    Messages:
    3,987
    Yes and no. RaR works well in network games and the same goes for RaRE. Sadly M:C will desync right away in network games because Kailric started the mod without knowing anything about this issue. To be fair, it's completely undocumented and I'm not sure if I had figured it out on my own without prior experience with network syncing in games. I do plan to fix this eventually, but it's not the top priority.

    When I first started modding, I worked on RaR. Less than a week after gaining access, I found and fixed a desync problem nobody ever encountered while playing. I found it simply by reading the code. That was back in the odd days where I was both a really inexperienced modder and a really experienced on at the same time :crazyeye:

    I still haven't figured out how to define my own network packages though. I have the impression that it is possible and that doing that will allow sending more complex data, like strings. If anybody knows how to do that, then please tell :)

    If you ask if I personally play with people I found the forum, then the answer is no. I only play with people I know in the offline world as well. Oh and I play with myself to debug desync issues. Not sure if that counts.
     
  9. M07

    M07 Chieftain

    Joined:
    Mar 29, 2009
    Messages:
    511
    Gender:
    Male
    Location:
    Canada
    Ah ah, it remember me before, when DoaNE was totally broken in MP games cause of that. If I have time I will write a little documentation on it.

    He he, I know but it is a secret. :D Just kidding.
    You can do that in python, thanks to the CvEventManager.py file.

    For example, for the seaway name i have to send the name written by a player to all other players :

    So you have to do that:
    Code:
    def __init__(self):
    		....
    		self.Events={
    			....
    			CvUtil.EventCreateSeaway: ('CreateSeaway', self.__eventCreateSeawayApply, self.__eventCreateSeawayBegin),
    
    def __eventCreateSeawayBegin(self, px, py):
    		popup = CyPopup(CvUtil.EventCreateSeaway, EventContextTypes.EVENTCONTEXT_ALL, True)
    		popup.setUserData((px, py))
    		popup.createEditBox(u"", 0)
    		popup.setEditBoxMaxCharCount( 19, 26, 0 )
    		popup.addButton(localText.getText("TXT_KEY_MAIN_MENU_OK", ()))
    		popup.launch(False, PopupStates.POPUPSTATE_IMMEDIATE)
    
    	def __eventCreateSeawayApply(self, playerID, userData, popupReturn):
    		iButton = popupReturn.getButtonClicked()
    		if iButton == 0:
    			'Create Seaway'
    			px = userData[0]
    			py = userData[1]
    			player = gc.getPlayer(playerID)
    			plot = CyMap().plot(px, py)
    
    			seawayName = popupReturn.getEditBoxString(0)
    			if (len(seawayName) == 0):
    				return
    			if (len(seawayName) > 30):
    				seawayName = seawayName[:30]
    
    			player.addSeaway(plot, seawayName)# Here it is a C++ call with a string in parameter. TADA!! :) 
    
    Ohh, it too sad.
    What I propose you, is to play together one day with DoaNE 5.0. I think I deserve it, don't you think? :)

    Ah Ah, not sure indeed.
     
  10. Nightinggale

    Nightinggale Chieftain Supporter

    Joined:
    Feb 2, 2009
    Messages:
    3,987
    I wrote this at some point, but I never got started writing real documentation. I think I know how it works, but going from that to writing something other people can learn from... well I never got around to do that.
    http://forums.civfanatics.com/showthread.php?t=525430

    So basically you just create the event, open a popup window in __eventCreateSeawayBegin and whenever somebody press a button, it calls __eventCreateSeawayApply on all computers?

    If so, then it is once again one of those wonderful undocumented features in the exe. I wonder if I can use this system with no popup to generate network traffic without the need for a popup window. That could be useful for the yield/traderoute GUI we have talked about a while ago for M:C.

    I will lose big time. Never play a game against its creator. People learned that the hard way with me :lol:

    I don't really play against human players. I do play coop against the AI occasionally though. This evens out the unfairness of skills and luck with the map and events.
     
  11. Lib.Spi't

    Lib.Spi't Overlord of the Wasteland

    Joined:
    Feb 12, 2009
    Messages:
    3,671
    Location:
    UK
    I would certainly be up for a game some time, once my brain stops melting out my ears from the latest version of the game! :D

    It was always those damn Era goals that got me!

    I want to expand!! Oh damn now I have to make twenty soldiers to meet the era goal.... :aargh:

    Hmm... maybe I need to download DoaNE again and have another play! (or try and find where ever it is buried on my old hardrive!
     
  12. westamastaflash

    westamastaflash Lord Commander

    Joined:
    Nov 1, 2007
    Messages:
    911
    Are you placing the code on GitHub so folks can submit bug fixes via pull request?

    One thing I can't figure out which I suspect is hardcoded into the DLL is the CyCity.canTrain() function - I'm trying to mod the mod so that I can train warships (frigates) in the colonies. Nothing in the xml indicates that I can't... so I'm guessing that there's something the DLL that is blocking this?
     
  13. Nightinggale

    Nightinggale Chieftain Supporter

    Joined:
    Feb 2, 2009
    Messages:
    3,987
    I placed M:C on GitHub and then we later decided to move to SourceForge because GitHub has a 1 GB limit for free accounts while SourceForge has the limit "anything reasonable for the project". I'm not sure what they define as reasonable, but I have seen 7 GB of game graphics being reasonable. This mean using SourceForge allows us to add all the graphics without considering server space while GitHub doesn't provide that freedom. GitHub is more feature rich, which mean it really is a tradeoff.

    I fully support placing the code on a public git server. It makes it easier to keep their local copy up to date while adding content of their own. At the same time if those modifications are also on public git servers, they can easily be merged back into DoaNE, meaning it is a two way transfer of improved code.
     
  14. M07

    M07 Chieftain

    Joined:
    Mar 29, 2009
    Messages:
    511
    Gender:
    Male
    Location:
    Canada
    He he, i understand but it one a the feature I love in this mod, to have eras and try to be the first one to reach it :)
     
  15. M07

    M07 Chieftain

    Joined:
    Mar 29, 2009
    Messages:
    511
    Gender:
    Male
    Location:
    Canada
    My code is since a long time in Bitbucket., in case you don't know it is GIT repository. But currently it is a private repository.

    Shame on me, it is hard coded : see the code below :
    Code:
    switch(eUnit) {
    			case UNIT_FRIGATE:
    			case UNIT_SHIP_OF_THE_LINE:
    			case UNIT_MAN_O_WAR:
    				return false;
    		}
     
  16. westamastaflash

    westamastaflash Lord Commander

    Joined:
    Nov 1, 2007
    Messages:
    911
    Thanks. I suppose I can just make a copy of the unit that can be manufactured in the colonies.

    I think it makes some historical sense to allow colonies to build warships. One of the largest warships of the era, the Santísima Trinidad (almost 5000t), was built in Havana (and was the flagship of the Spanish against the English in the American Revolutionary War)

    https://en.wikipedia.org/wiki/Spani...la_Santísima_Trinidad#Design_.26_construction
     
  17. M07

    M07 Chieftain

    Joined:
    Mar 29, 2009
    Messages:
    511
    Gender:
    Male
    Location:
    Canada
    We agreed about that, but you can see in your link that this ships was launched the 3 March 1769 and the Colonization game ends in 1776. So we may consider it but only at the end of the game.
     

Share This Page