Advertisement
Civilization Fanatics' Center

Go Back   Civilization Fanatics' Forums > CIVILIZATION IV > Civ4 - Creation & Customization > Civ4 - Project & Mod Development > Inactive Projects > Civ4 - Star Wars Mod

Notices

Reply
 
Thread Tools
Old Sep 29, 2009, 11:35 AM   #1
HolmstN
Chieftain
 
Join Date: Sep 2009
Posts: 29
DLL Modding

From this thread.

Objectives:
  • Familiarize with the code base and team structure in order to operate smoothly
  • Create a solid code foundation for a Civilization 4 Star Wars mod

High Priority Tasks:
  • Domain-Terrain relationships

Middle Priority Tasks:
  • Promotion Expiration Tag
  • Superweapons AI
  • Python Buttons AI

Low Priority Tasks:
  • Unit Creation on Project Completion
  • Unique Building AI Conquer

Please post any requests for DLL implementations here. Also when posting, place a "rank" of importance for the request. This way, we can go through and logically maneuver into the SDK.

Last edited by HolmstN; Oct 04, 2009 at 08:20 AM.
HolmstN is offline   Reply With Quote
Old Sep 29, 2009, 03:46 PM   #2
TC01
Deity
 
TC01's Avatar
 
Join Date: Jun 2009
Location: Irregularly Online
Posts: 2,135
Images: 2
Welcome to the mod team!

As the person doing the python modding (Python callbacks, if you don't know, are called from the SDK and allows you to make things happen without editing the game core) I have some things that would be better done by making some tags in the SDK or other stuff. The DLL/SDK/C++ runs a lot faster then the Python.

Fall from Heaven 2 has a tag in CIV4PromotionInfos.xml that allows a promotion to have a chance of being worn off each turn. I want to do something similar, and so I've just used onBeginPlayerTurn, a python function, to remove certain promotions, rather then add a tag there. So I think adding the iExpireChance tag to promotions would be something useful to have. Middle Priority.

Less important would be adding some tags to CIV4ProjectInfos.xml to cause units to be created in the city making the project on project completion. (A "UnitClassCreated" and "iUnitsCreated", one getting the unitclass and the other the number of units created). I've used onProjectBuilt in the python to cause superweapons to be built. Low Priority.

There's probably other stuff, but these are the first requests I made in the other thread, so I thought I'd repost them here with a little more detail.
TC01 is offline   Reply With Quote
Old Sep 29, 2009, 04:03 PM   #3
HolmstN
Chieftain
 
Join Date: Sep 2009
Posts: 29
Alright thanks! I appreciate the formatting, I work better with a pattern-based format, hehe. I'll start putting some things together and let you know how it's going as soon as I can.

Is there an easy way to contact you, by the way, AIM or xfire perhaps? Some simple questions are better asked through those methods, hehe.
HolmstN is offline   Reply With Quote
Old Sep 29, 2009, 05:25 PM   #4
TC01
Deity
 
TC01's Avatar
 
Join Date: Jun 2009
Location: Irregularly Online
Posts: 2,135
Images: 2
The easiest way is to probably send me a PM here, on CFC, if you need anything. I answer those as quickly as possible, usually.

Also, here's a useful tutorial on the SDK, if you need any help (if you haven't already seen this). While I haven't actually done any work with it yet, I've gone through the tutorial and began learning about the SDK side of things, and found it a pretty good help.
TC01 is offline   Reply With Quote
Old Sep 29, 2009, 10:13 PM   #5
HolmstN
Chieftain
 
Join Date: Sep 2009
Posts: 29
Ooh, thanks for the tutorial link. The biggest and hardest opponent in coding is having to figure out all the different relationships the original creators decided to use. Of course I'm sure you're at least slightly familiar with this as XML isn't necessarily all that different (but the XML tool really helps! ). This'll speed up the process quite a bit as I don't have to go searching for every blasted little detail, muahaha.

HolmstN is offline   Reply With Quote
Old Sep 30, 2009, 05:39 AM   #6
civ editor11
Ruler
 
civ editor11's Avatar
 
Join Date: Jan 2009
Location: U.S.
Posts: 999
Do you think you might be able to do AI programming. TC01 has some new game concepts that we'd like the AI to use. These are the python buttons, the superweapons, and possibly later on you could influence them to capture planets with the unique buildings.

Python buttons AI: Middle Priority

Superweapons AI: Middle priority I'd prefer you do this before the python buttons because I think the AI could really use the superweapons. If we don't let them use it iit gives the human too much advantage.

Unique buildings conquer AI: Low Priority This one was just an idea I'd had since a whole bunch of people will naturally go after the unique buildings so they can build themselves a better army. This is probaly something you could do after we release version 1.

Hope I'm not giving you too much to do I have no skill in AI programming so I thought you might be able to do it. There isn't a tutorial to teach you how to do this.
__________________
aoccdrnig to a rscheearch at Cmabrigde Uinervtisy, it dseno't mtaetr in waht oerdr the ltteres in a wrod are, the olny iproamtnt tihng is taht the frsit and lsat ltteer be in the rghit pclae. The rset can be a taotl mses and you can sitll raed it whotuit a pboerlm. Tihs is bcuseae the huamn mnid deos not raed ervey lteter by istlef, but the wrod as a wlohe. fi yuo cna raed tihs, palce it in yuor siantugre. Olny 55% of plepoe can.
Click here to feel my wrath Click here not to feel my wrath
Help us with the Star Wars Mod and World 2009 Join us
civ editor11 is offline   Reply With Quote
Old Sep 30, 2009, 03:44 PM   #7
TC01
Deity
 
TC01's Avatar
 
Join Date: Jun 2009
Location: Irregularly Online
Posts: 2,135
Images: 2
The problem with the python buttons is that instead of doing them properly by adding new missions to the SDK (and, I have no idea how to actually make a mission I add to CvEnums.h do anything) I added them in python- the AI has no clue that they exist. So to make them able to do anything, you would need to either:

a. Do some serious python scripting in, well, python. The AI would be made to do use specific powers at certain times in the game.

b. Move the buttons to the SDK.


I don't know how much of an issue the superweapons would be. The AI understands how to make a unit nuke stuff, right? (One issue might be getting them to build the projects that create the superweapons... the AI should be weighted to build projects that generate units).

Again, the issue is that since the different nuke effects are handled in python, getting the AI to understand when to use which one would be challenging. A possible method would be adding tags such as "bSunCrusher", "bDeathStar", "bWorldDevastator" to CIV4UnitInfos. All this would mean is that marking a unit "bSunCrusher" means the AI will handle it in a certain manner (targeting non-space terrain surrounded by lots of units) whereas the bWorldDevastator tag would cause it to target planetary terrain regardless of the number of units or not...


By Unique Buildings AI... you mean the "planetary buildings" thing? This is probably the easiest request, since all you would have to do is make the AI go after cities with specific buildings- i.e, the planetary buildings.
TC01 is offline   Reply With Quote
Old Sep 30, 2009, 04:53 PM   #8
HolmstN
Chieftain
 
Join Date: Sep 2009
Posts: 29
Following along with TC01's thought, Superweapons are (ideally) going to be units created from projects, correct? If that's the case, the AI can treat them like any other unit and "special abilities" can be tagged onto the unit. It may even be easier to add a unique trait that can carry through the Superweapons rather than actually do anything too fancy.

Think of it like a Unit Promotion. All Death Stars have the "Look at the pretty green laser and DIEEE" promotion, but differing Death Star units (IE, Death Star I, II) might have different traits (such as attack and defense power). With this line of thought, just like a nuke, the AI should be able to catch on. Additionally, it makes coding the Superweapons at that much easier. Oh, and also they could all be tagged with some sort of "Threat" tag that makes AI more inclined to attack said unit.


Now, you'll have to excuse my idiocy here. Which python "buttons" are you referring to? Having not played the build, I'm working a bit blind here, hehe.
HolmstN is offline   Reply With Quote
Old Sep 30, 2009, 05:11 PM   #9
TC01
Deity
 
TC01's Avatar
 
Join Date: Jun 2009
Location: Irregularly Online
Posts: 2,135
Images: 2
One of civ editor's first requests was a system akin to the Fall from Heaven 2 spell system (actually, if you used something like that it might make this easier), where certain units would be given access to "Force Powers". I also added a special ability called Ion Blast for fighter units. If you want to look at the code for this, the necessary files are CvMainInterface.py (in Assets\Python\Screens), StarWars.py (in Assets\Python), CvEventManager.py (in Assets\Python) and CvGameUtils.py (in Assets\Python).

There's a tutorial linked in my signature on how to make python-only buttons like these, for more detail on how I did it. But the way this works is that the AI doesn't even know these buttons exist.
TC01 is offline   Reply With Quote
Old Sep 30, 2009, 05:43 PM   #10
Jawa'sRevenge
Warlord
 
Jawa'sRevenge's Avatar
 
Join Date: May 2009
Location: Galaxy Far Far Away
Posts: 246
A list of things I think should be in the dll:

AI:

Prioritize capturing planets
Bombard and invade, or just huge invasion (star wars invasion strategy)
More aggressive AI
AI that expands quickly (Risks more, to expand)
Is focused on dominating the galaxy, not on culture not on defence
Using hyperlanes ???
Blockading
Hunting mobile enemy (aka: the Rebels)

Other:

Remove citizens; make production cost credits and time; ships can only be build on worlds that have shipyard, and then only ships they are allowed to produce (Kaut=star destroyers)

Make mountains passable again (see mountains back into service)

Thats all I can think of for now:

Also if you need help merging I can help; I know a little C++ and can (probably) compile dll's; I am well averse in the use of WinMerge
Jawa'sRevenge is offline   Reply With Quote
Old Oct 03, 2009, 02:32 PM   #11
HolmstN
Chieftain
 
Join Date: Sep 2009
Posts: 29
I seem to be running into some compile trouble. Does anyone have the SDK? Can you do me a favor and check for "CvGameInterface.cpp"? I don't have the file but the compiler is looking for it for some reason.
HolmstN is offline   Reply With Quote
Old Oct 03, 2009, 04:55 PM   #12
civ editor11
Ruler
 
civ editor11's Avatar
 
Join Date: Jan 2009
Location: U.S.
Posts: 999
Here the file is unmodified and from 3.19.
Attached Files
File Type: 7z CvGameInterface.7z (106 Bytes, 10 views)
__________________
aoccdrnig to a rscheearch at Cmabrigde Uinervtisy, it dseno't mtaetr in waht oerdr the ltteres in a wrod are, the olny iproamtnt tihng is taht the frsit and lsat ltteer be in the rghit pclae. The rset can be a taotl mses and you can sitll raed it whotuit a pboerlm. Tihs is bcuseae the huamn mnid deos not raed ervey lteter by istlef, but the wrod as a wlohe. fi yuo cna raed tihs, palce it in yuor siantugre. Olny 55% of plepoe can.
Click here to feel my wrath Click here not to feel my wrath
Help us with the Star Wars Mod and World 2009 Join us
civ editor11 is offline   Reply With Quote
Old Oct 03, 2009, 06:24 PM   #13
HolmstN
Chieftain
 
Join Date: Sep 2009
Posts: 29
Thanks! Do you happen to have the Header file as well?
HolmstN is offline   Reply With Quote
Old Oct 04, 2009, 07:17 AM   #14
civ editor11
Ruler
 
civ editor11's Avatar
 
Join Date: Jan 2009
Location: U.S.
Posts: 999
There is no header for it in my DLL.
If you could would you change domain air, land, and naval/sea. I would like domain land to not be able to go into tundra/Space or Orbit. It would be good if domain Air couldn't travel into Space/Tundra, but it can move like domain land. Is that possible? I woulld like domain Naval to be able to go anywhere including over planets because that happened all the time in star wars.
New Terrain Types: If you can do it High Priority
__________________
aoccdrnig to a rscheearch at Cmabrigde Uinervtisy, it dseno't mtaetr in waht oerdr the ltteres in a wrod are, the olny iproamtnt tihng is taht the frsit and lsat ltteer be in the rghit pclae. The rset can be a taotl mses and you can sitll raed it whotuit a pboerlm. Tihs is bcuseae the huamn mnid deos not raed ervey lteter by istlef, but the wrod as a wlohe. fi yuo cna raed tihs, palce it in yuor siantugre. Olny 55% of plepoe can.
Click here to feel my wrath Click here not to feel my wrath
Help us with the Star Wars Mod and World 2009 Join us

Last edited by civ editor11; Oct 04, 2009 at 07:32 AM.
civ editor11 is offline   Reply With Quote
Old Oct 04, 2009, 08:21 AM   #15
HolmstN
Chieftain
 
Join Date: Sep 2009
Posts: 29
Alright then, thanks

I'll do what I can with the domains, I'll keep you in the loop on its progression as I take a look inside.
HolmstN is offline   Reply With Quote
Old Oct 04, 2009, 12:39 PM   #16
civ editor11
Ruler
 
civ editor11's Avatar
 
Join Date: Jan 2009
Location: U.S.
Posts: 999
Thank you do the best you can
__________________
aoccdrnig to a rscheearch at Cmabrigde Uinervtisy, it dseno't mtaetr in waht oerdr the ltteres in a wrod are, the olny iproamtnt tihng is taht the frsit and lsat ltteer be in the rghit pclae. The rset can be a taotl mses and you can sitll raed it whotuit a pboerlm. Tihs is bcuseae the huamn mnid deos not raed ervey lteter by istlef, but the wrod as a wlohe. fi yuo cna raed tihs, palce it in yuor siantugre. Olny 55% of plepoe can.
Click here to feel my wrath Click here not to feel my wrath
Help us with the Star Wars Mod and World 2009 Join us
civ editor11 is offline   Reply With Quote
Old Oct 11, 2009, 09:53 AM   #17
HolmstN
Chieftain
 
Join Date: Sep 2009
Posts: 29
Ok sorry it's been so long, been a busy couple of weeks for me.

For the Domains, what do we want DOMAIN_SPACE to do? If it's similar enough to AIR, I feel we can just use AIR and NAVAL to already do what we want without the need to add a new domain.

What are the Python buttons that you want implemented?

Last edited by HolmstN; Oct 11, 2009 at 09:59 AM.
HolmstN is offline   Reply With Quote
Old Oct 11, 2009, 10:33 AM   #18
TC01
Deity
 
TC01's Avatar
 
Join Date: Jun 2009
Location: Irregularly Online
Posts: 2,135
Images: 2
Quote:
Originally Posted by HolmstN View Post
Ok sorry it's been so long, been a busy couple of weeks for me.

For the Domains, what do we want DOMAIN_SPACE to do? If it's similar enough to AIR, I feel we can just use AIR and NAVAL to already do what we want without the need to add a new domain.

What are the Python buttons that you want implemented?
Essentially, all the domain should do is allow a unit to go over both land (planets) and water (space). So, I don't think there's any reason to create a new domain at all, just use Water and make Water able to use all terrains, both land and water.
TC01 is offline   Reply With Quote
Old Oct 11, 2009, 12:19 PM   #19
HolmstN
Chieftain
 
Join Date: Sep 2009
Posts: 29
Quote:
Originally Posted by TC01 View Post
Essentially, all the domain should do is allow a unit to go over both land (planets) and water (space). So, I don't think there's any reason to create a new domain at all, just use Water and make Water able to use all terrains, both land and water.
Ok, sounds good to me and much easier a fix- just remove a couple lines of code Are there any 'special circumstances' with the Terrain that we want this new Sea Domain to be affected by?

Last edited by HolmstN; Oct 11, 2009 at 12:34 PM.
HolmstN is offline   Reply With Quote
Old Oct 13, 2009, 01:56 PM   #20
HolmstN
Chieftain
 
Join Date: Sep 2009
Posts: 29
Just to let you all know, anything classified in the Sea domain should be able cross land and sea now. I have yet to test it in-game for sure, but the code is all in place and simply needs to be compiled and uploaded if anyone feels like taking a gander.

Still a couple of questions floating:

1) Python buttons, a list of them needed implementation (and their function preferably)

2) Any special Domain qualities DOMAIN_SEA should have besides being both land-and-sea capable.
HolmstN is offline   Reply With Quote
Reply

Bookmarks

Go Back Civilization Fanatics' Forums > CIVILIZATION IV > Civ4 - Creation & Customization > Civ4 - Project & Mod Development > Inactive Projects > Civ4 - Star Wars Mod > DLL Modding

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Advertisement

All times are GMT -6. The time now is 02:36 PM.


Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
This site is copyright Civilization Fanatics' Center.
Support CFC: Amazon.com | Amazon UK | Amazon DE | Amazon CA | Amazon FR