Would like to help write tests - how to get involved?

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

Moderator: Committer

Post Reply
Message
Author
leizhaoyn
Space Krill
Posts: 4
Joined: Tue Jul 21, 2015 9:18 pm

Would like to help write tests - how to get involved?

#1 Post by leizhaoyn »

I'm new to this forum, and am a freelance web designer/developer. I'm looking for a way to contribute to FO, maybe by helping write tests. What's the screening process for people interested in contributing? What areas are most in need of help? I'm at a pretty junior level in terms of actual programming, but might also be of help with some front-end work.

User avatar
MatGB
Creative Contributor
Posts: 3310
Joined: Fri Jun 28, 2013 11:45 pm

Re: Would like to help write tests - how to get involved?

#2 Post by MatGB »

Depends on how much code you can do (I'm not even a webdev, I just dabble a bit for fun). Most of the user facing game content is written in a bespoke (and easier-than-HTML) scripting language we call FOCS. In addition, the AI is written in Python which I know is also used in some web work.

We always need help with scripting content (or just bughunting and balancing existing scripts), and the AI team has expanded recently and has huge amounts of things on their "to do, eventually" list.

Alternatively, there are issues with the way rendering is done on screen (that are above my head) and there's always graphics work in need of doing (including someone cataloging and listing all the graphics work that needs doing ;-) ).

Not being a Dev, at all, not at all sure how you "write tests", but from a playtester/players perspective, anything that increases the framerate, graphics rendering or effects processing speeds is a good thing, and identifying where the lags are can lead to very quick responses.

If you want to get involved in the content scripting side, then I can easily give you a list of simple-to-start-with things that I've been wanting to do for ages, beyond that up to you.
Mat Bowles

Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Would like to help write tests - how to get involved?

#3 Post by Geoff the Medio »

leizhaoyn wrote:What's the screening process for people interested in contributing?
Can you edit a text file with a line-ending preserving editor? Can you download and build the source code? Can you make a pull request on github? If the answer two at least two of those is yes, you can probably help with scripting or programming.

leizhaoyn
Space Krill
Posts: 4
Joined: Tue Jul 21, 2015 9:18 pm

Re: Would like to help write tests - how to get involved?

#4 Post by leizhaoyn »

Thanks for getting back to me on this quickly! What I meant by testing was not play-testing, but rather writing automated tests on the backend that would be run before any release to check for bugs.

If content scripting is an area of need, then yes, please share the list of simple-to-start-with things so I can take a look.

I am familiar with pull requests using Github. I should be able to to build the source code. As for editing a text file, I'm set up with both XCode and Sublime Text 3. Can I send you guys a code sample for a tech assessment I had to do in Python for a job interview? Would that be useful to gauge at what level I could contribute?

User avatar
Dilvish
AI Lead and Programmer Emeritus
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

Re: Would like to help write tests - how to get involved?

#5 Post by Dilvish »

leizhaoyn wrote:Can I send you guys a code sample for a tech assessment I had to do in Python for a job interview? Would that be useful to gauge at what level I could contribute?
If you say you can swim, we're willing to just throw you in the water. :D
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

leizhaoyn
Space Krill
Posts: 4
Joined: Tue Jul 21, 2015 9:18 pm

Re: Would like to help write tests - how to get involved?

#6 Post by leizhaoyn »

Hahaha, niceee. Yeah, that's fair. OK, well, please feel free to send some smaller tasks my way as a test.

User avatar
Dilvish
AI Lead and Programmer Emeritus
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

Re: Would like to help write tests - how to get involved?

#7 Post by Dilvish »

[Oh, while I've been writing this, you've already replied, so my reply to that is at the very bottom.]

On a more serious note, we don't have any kind of rigorous test suite here. Adrian_broher did, I believe, set up some automated testing for our parsers, but I haven't really looked at that (and I had the impression it was pretty much complete). There's been a little bit of debate about whether more investment in some more formal testing approach would be worthwhile, but it's important to keep in mind that we're a small group of volunteers working on a project whose end users would (I believe) happily settle for the current very-good-even-if-not-perfect reliability and get more features, rather than some incremental improvement in generic reliability. Sometimes significant bugs pop up and we're generally successful at squishing them promptly. It's not like some commercial business application where any nontrivial question about reliability can be make-or-break for the product.

So, that's why we immediately say "coding", "scripting", "artwork" when you've asked "testing?"

Most of the code, essentially all of the real engine and UI, is in C++. The AI is written in python, as is our universe generation code; they interact with the main engine using a boost::python interface. Our wiki has a number of pages about different ways to contribute, such as this one. Here is a page more focused on the AI. As you can see, our wiki still needs a tremendous bit more development itself, so as you learn more about varius aspects of the project if you want to write for our Wiki that would be really great as well. Here is a somewhat stale page that gives more detail about the structure and logic of the AI.

And, as Matt has said, he has plenty of content scripting projects he could hand off. A stub page for our scripting language is linked in that python development page, for now be sure to follow it one more link jump to the Effects page.

So I suggest you keep up with the discussions on our boards, probably start with a bit of content scripting work, and then start poking around with some of the python code and see if you want to work with that. Adrian_broher might also have testing suggestions for you, even.

Since while I've been writing this you've already confirmed you'd like to try jumping into a task, I'll mention a couple, and perhaps Mat can mention one or two scripting projects you could look at. For the AI, one toe-dipping task you could look at would be with the AI's chat responses, and if you liked that you could look at developing the AI diplomacy a bit more. We don't have any significant diplomacy yet, the AI has some chance of accepting or rejecting a peace request, depending on its aggression level, and won't ever declare war except at the start of the game. Chat and Diplomacy are handled in default/AI/FreeOrionAI.py and default/AI/DiplomaticCorp.py We just recently cut back sharply on AI chat responses so they don't drown out a human conversation in a multiplayer game, but one little customization I'd like to do is to have the message used for that current one initial chat message, be customized/selected based on the metabolism of the species of the Capital of the contacted AI. Just as a flavor sort of thing. To progress to Diplomacy, there should be a chance that, even after accepting peace, the AI would again declare war. The trigger would depend upon the AI aggression level-- A Maniacal IA might declare war if you even send a ship a single time onto their supply lanes (and they see it). At the other end, a Beginner AI would never declare war, perhaps not a Turtle either, but a Cautious AI might declare if you've been colonizing too many planets in their supplied zone, and their assessment of Fleet strength makes them confident they can take you on.

To do any of that python work, you will probably want to take advantage of this very handy tool that Cjkjvfnby developed for us, located here (of course really I mean the corresponding location on your local drive). Inside the results folder is a "FreeOrionInterface.py" file which you can add to your IDE's pythonpath so that it has information about the FreeOrionInterface (which in regular gameplay is actually provided via the C++ code and boost interface). When there are updates to our booth python interface, that inspector module can be run to update the interface file. This is also someplace you could look for a more challenging task-- our Server python interface (for universe generation and scripted events) has a substantial but not complete overlap with this client AI interface, but it is currently lacking this nice IDE interface file. You could look at adapting this AI IDE tool to make another one for the server interface (located in python/server, while the universe generation code is in default/python). This would be a pretty challenging task, and maybe isn't really suitable for a newcomer to the project, but it would certainly force you to learn a lot about the project.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

User avatar
adrian_broher
Programmer
Posts: 1156
Joined: Fri Mar 01, 2013 9:52 am
Location: Germany

Re: Would like to help write tests - how to get involved?

#8 Post by adrian_broher »

leizhaoyn wrote:What's the screening process for people interested in contributing?
There is no such thing as a screening process as we are not a company and don't hire people. If the code matches with the project goals and is 'good' (on the projects definition of 'good') it will be integrated, if not you will get feedback on how to improve it.

leizhaoyn wrote:[…] writing automated tests […]
Yeah, no. Couldn't keep a straight face. :3

The code in such a bad state that such thing is nearly impossible without bin-ing a good chunk of code. There is no in project infrastructure for such thing and if you think of using something like Travis or AppVeyor think again. Both have time limitations for compiles which this project far exceeds.

leizhaoyn wrote:I'm looking for a way to contribute to FO […]
I would start with asking you what you're able to do (like having what kind of knowledge) and if you're joining with a specific goal in mind, like 'I want to learn OpenGL'.

You already mentioned that you're freelance web designer/developer. What do the other project members think about creating a 'proper' project page? Would it be okay to do something job related in your free time? Of course you could use such a page as a portfolio entry.
Last edited by adrian_broher on Wed Jul 22, 2015 10:12 am, edited 2 times in total.
Resident code gremlin
Attached patches are released under GPL 2.0 or later.
Git author: Marcel Metz

User avatar
Dilvish
AI Lead and Programmer Emeritus
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

Re: Would like to help write tests - how to get involved?

#9 Post by Dilvish »

adrian_broher wrote:You already mentioned that you're freelance web designer/developer. What do the other project members about creating a 'proper' project page?
When you say it like that, the idea seems obvious. :D A nicer project page sounds quite appealing.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

User avatar
biza
Space Squid
Posts: 67
Joined: Wed May 29, 2013 6:48 pm

Re: Would like to help write tests - how to get involved?

#10 Post by biza »

Dilvish wrote: A nicer project page sounds quite appealing.
Well, maybe also i can help with that, what did you have on mind?
Simple static HTML page, or open source CMS like Joomla with backend and ability to post news?

leizhaoyn
Space Krill
Posts: 4
Joined: Tue Jul 21, 2015 9:18 pm

Re: Would like to help write tests - how to get involved?

#11 Post by leizhaoyn »

biza wrote:biza
Hmm, yeah, I would love to collaborate on producing a better project page - Joomla or WP if you'd want something dynamic. Otherwise, a quick static HTML page using Bootstrap maybe?
Dilvish wrote:I would start with asking you what you're able to do (like having what kind of knowledge) and if you're joining with a specific goal in mind, like 'I want to learn OpenGL'.
I would love to actually contribute to the AI scripting since I've been in need of a project to help spur me to learn more Python.

User avatar
Cjkjvfnby
AI Contributor
Posts: 539
Joined: Tue Jun 24, 2014 9:55 pm

Re: Would like to help write tests - how to get involved?

#12 Post by Cjkjvfnby »

Dilvish wrote:You could look at adapting this AI IDE tool to make another one for the server interface (located in python/server, while the universe generation code is in default/python). This would be a pretty challenging task, and maybe isn't really suitable for a newcomer to the project, but it would certainly force you to learn a lot about the project.
I already have this in my local branches.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

User avatar
Cjkjvfnby
AI Contributor
Posts: 539
Joined: Tue Jun 24, 2014 9:55 pm

Re: Would like to help write tests - how to get involved?

#13 Post by Cjkjvfnby »

Here is example of universe generation stub:

https://github.com/Cjkjvfnby/freeorion/pull/13
  • Checkout branch
  • Deploy code (My way: change config.xml <resource-dir> to default folder in repo)
  • Start any game (Game will exit to menu)
  • Check freeoriond.log for errors
  • Stab is ready at default\AI\freeorion_debug\ide_tools\result\freeorion.py
Upd. I got some mess in pr, fix it by creating new
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

User avatar
Vezzra
Release Manager, Design
Posts: 6095
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Re: Would like to help write tests - how to get involved?

#14 Post by Vezzra »

Just tried it, works perfectly! Very useful, no more warnings about the missing import module by the PyCharm code inspector, and code completion works for the freeorion interface. Thanks a lot :D
Upd. I got some mess in pr, fix it by creating new
Ok... but I didn't notice any problems...

Post Reply