new to programming but want to help

Programmers discuss here anything related to FreeOrion programming. Primarily for the developers to discuss.

Moderator: Committer

Post Reply
Message
Author
drehacopian
Space Krill
Posts: 1
Joined: Tue May 17, 2022 10:36 pm

new to programming but want to help

#1 Post by drehacopian »

Hi, Im ok with python and I loved MOO2.

I want to help but I have no idea how.

I would do anything to gain more experience as I can and eventually switch careers. what should I do?

o01eg
Programmer
Posts: 2004
Joined: Sat Dec 10, 2011 5:46 am

Re: new to programming but want to help

#2 Post by o01eg »

We mostly use Python for AI scripting also I gradually converting content scripts from own language to Python but the last isn't fully supported in the C++ backend code so I'm not sure what possible to do here with Python knowledge.
Gentoo Linux x64, gcc-11.2, boost-1.78.0
Ubuntu Server 22.04 x64, gcc-12, boost-1.74.0
Welcome to the slow multiplayer game at freeorion-lt.dedyn.io.Version 2024-03-15.b3de094.
Donations're welcome:BTC:bc1q007qldm6eppqcukewtfkfcj0naut9njj7audnm

Ophiuchus
Programmer
Posts: 3433
Joined: Tue Sep 30, 2014 10:01 am
Location: Wall IV

Re: new to programming but want to help

#3 Post by Ophiuchus »

drehacopian wrote: Tue May 17, 2022 11:00 pm I would do anything to gain more experience as I can and eventually switch careers. what should I do?
There is quite a lot python work possible in AI and a bit in universe generation.
If you want to gain experience, both are good places to start; especially if you like playing the game.

You need to understand how the game works though for meaningful contributions. Best for getting game experience (besides playing single player) would be to e.g. join the next multiplayer game if it is allied.

You could then start (trying to) modify e.g. the universe generation scripts. If you played enough with that, we can give you some task. (One idea: make sure that there is at least one medium good planet for every capital species in e.g. five hops distance which is not blockaded by monsters).

Or you could observe the AI in local multiplayer as an observer and figure out what they do wrong. Read the AI python code and try figure out what it does.
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Look, ma... four combat bouts!

User avatar
LienRag
Cosmic Dragon
Posts: 2148
Joined: Fri May 17, 2019 5:03 pm

Re: new to programming but want to help

#4 Post by LienRag »

There is a simple thing to do with the AI : generate peace automatically between AIs after a certain number of turns on "Maniacal" level.

I had a quick look at the code and it didn't seem to be really hard once you've found where it is (I'm not very proficient at Python, though, and know nothing of C++).

The problem when I suggested this was that nobody was sure that the AI were able to manage peace, but someone tried and there wasn't any big problem.

You can start with hardcoded turn numbers for peace, and work from here to more nuances (like making peace when they see - or deduce - the player's production/research outclassing them).

User avatar
Grummel7
Space Dragon
Posts: 335
Joined: Mon Oct 09, 2017 3:44 pm

Re: new to programming but want to help

#5 Post by Grummel7 »

LienRag wrote: Wed May 18, 2022 12:54 pm There is a simple thing to do with the AI : generate peace automatically between AIs after a certain number of turns on "Maniacal" level.

I had a quick look at the code and it didn't seem to be really hard once you've found where it is (I'm not very proficient at Python, though, and know nothing of C++).

The problem when I suggested this was that nobody was sure that the AI were able to manage peace, but someone tried and there wasn't any big problem.

You can start with hardcoded turn numbers for peace, and work from here to more nuances (like making peace when they see - or deduce - the player's production/research outclassing them).
I think this should be a game option, not simply tied to maniacal. But of course for implementing it, you can use fixed values at first.

Also it only makes sense in single player mode. I often test the AI by pitting several of them against each other in a multi-player game without humans and I don't want them to stop fighting at some point.

User avatar
LienRag
Cosmic Dragon
Posts: 2148
Joined: Fri May 17, 2019 5:03 pm

Re: new to programming but want to help

#6 Post by LienRag »

You're obviously right.
But for a beginner's first contribution, let's make it simple to begin with (from the glimpse of code I've seen, it should be very simple to do actually).

User avatar
Oberlus
Cosmic Dragon
Posts: 5715
Joined: Mon Apr 10, 2017 4:25 pm

Re: new to programming but want to help

#7 Post by Oberlus »

Adding a game rule to be used in python is easy. Check out this:

https://github.com/freeorion/freeorion/ ... bfbde80885

o01eg
Programmer
Posts: 2004
Joined: Sat Dec 10, 2011 5:46 am

Re: new to programming but want to help

#8 Post by o01eg »

I could mention that techs files which don't require changes in C++ aren't rare https://github.com/freeorion/freeorion/pull/3859
Gentoo Linux x64, gcc-11.2, boost-1.78.0
Ubuntu Server 22.04 x64, gcc-12, boost-1.74.0
Welcome to the slow multiplayer game at freeorion-lt.dedyn.io.Version 2024-03-15.b3de094.
Donations're welcome:BTC:bc1q007qldm6eppqcukewtfkfcj0naut9njj7audnm

Post Reply