Indepth development guides


Questions, Explanations, Howtos

Bim

Crypt Cleanser

Posts: 700

Joined: Wednesday, 5th January 2011, 15:51

Post Sunday, 24th February 2013, 15:50

Indepth development guides

Hello,
As a long time poster/lurker on these forums, one thing that floods the game design forum are ideas for new Gods/Characters.
Unfortunately, as good as some of these suggestions are, they frankly don't really have any chance of being made (although certain aspects may do, and there is always the far off possibility that a developer may take up the mantle).
Although a lot of people aren't good at coding, and the simple suggestion would be 'learn coding/search through everything', I think it would be really helpful if we/people in the know could put together a quick tutorial (which could be expanded on) on how to make a new character (gods might be harder, although maybe a broad outline could be given).

This would stem the endless tide of 'here is my new character/god idea' threads, as it'd be much easier for someone to prototype their own idea and show it off, instead of just trying to convince a dev. to do it. Obviously it'd still take some technical know how, and coding in any specific/big changes would be a much bigger challenge, but it would at least be a good place to point people serious enough about their ideas without it being too daunting a task.

Unfortunately, I don't have the technical expertise to be able to do this with any degree of usefulness (I've tinkered but I haven't actually created a char or god), howeverI would be very available to help test/expand on it for newbies. I've got a list of some ideas that need covering, and I'd happily set up the wiki pages, edit and test any information given.

Char. dev.:
-Where the relevant files are
-adding to the char. list and choosing an avatar.
-Stats and skill attributes
-innate mutations
-innate resistances/weaknesses
-undead
-char. speed/size/restrictions
-Levelling changes (both in stats and in mutations)
-Breath/innate abilities (a difficult one, but focusing on an innate magic skill would be useful)

God dev(?):
-Adding an altar
-Piety gain/loss
-Gifting
-passive/active abilities and cost
-wrath

Both of these examples could be very simple and would probably benefit from being much more straightforward/basic than anything currently in crawl. Possibly like a naga (deformed body, slow, spit poison and levels up with armour being it's defining attributes) and possibly like makleb/Oku for a god.

(p.s, I have read the patching guide and I realise their is probably bits of info about, I'd just like to collate it into a proper tutorial)
2012 Winner of fewest proposed ideas implemented by devs.

Ziggurat Zagger

Posts: 6393

Joined: Friday, 17th December 2010, 18:17

Post Sunday, 24th February 2013, 21:04

Re: Indepth development guides

I like the idea. It would be great if we could channel a lot of the proposal energy into actual coding efforts. njvack and I are working on a new sticky for GDD; we'll include your idea. I think you mean "species" not "character" though.

Spider Stomper

Posts: 243

Joined: Sunday, 28th August 2011, 14:04

Post Sunday, 24th February 2013, 21:29

Re: Indepth development guides

Well, most ideas in GDD are quite bad. IMO a good idea for a race should be something very simple, which is focused on a mechanism of game. The most recent race added to the game, octopodes, is a good example of this. Anyway, I think this is the minimum amount of changes required to create a basic race.

Branch: Create a new branch with 'git branch'.
Enumeration: Add a new value to species_type in enum.h.
Name: species_name() in species.cc
Order: species_order[] in species.cc
Abbrev: Species_Abbrev_List[] in species.cc
Genus: species_genus() in species.cc
Monster type: Add a new monster type in mon-data.h and enum.h. Edit player_species_to_mons_species() in species.cc
Aptitudes: aptitudes.h
Experience modifier: species_exp_modifier() in species.cc
HP modifier: species_hp_modifier() in species.cc
MP modifier: species_mp_modifier() in species.cc
Description: dat/descript/species.txt
Description of ghosts: Edit get_ghost_description() in describe.cc
Allowed jobs: job_allowed() in ng-restr.cc
Weapon preferences: weapon_restriction() ng-restr.cc
Stats: _species_stat_init() in ng-setup.cc
Mutations: give_basic_mutations() in ng-setup.cc
Resistances: A lot of functions in player.cc
Tiles: Put your images in rltiles/player/base and edit rltiles/dc-player.txt. Then edit tilep_species_to_base_tile() and tilep_race_default() in tilepick-p.cc.

For this message the author CommanderC has received thanks: 3
Bim, Marbit, rebthor

Bim

Crypt Cleanser

Posts: 700

Joined: Wednesday, 5th January 2011, 15:51

Post Sunday, 24th February 2013, 21:36

Re: Indepth development guides

Grimm - I'm glad that you liked the proposal - please let me know here (or through messages) if I can be of any help from a testing/editorial standpoint.

CommanderC - Thanks very much for the outline of places, I'm sure that will already help a lot. I have to agree that a lot of the ideas put forward on GDD are pretty useless, but I think it's mainly due to the inability for most people to prototype their ideas, which leads to them thinking that their idea would definitely work/be fun. Hopefully a strong tutorial would get rid of endless debates over if an idea would work or not and lead to better suggestions.

(as an aside: As far as 'character' goes, I had meant to add that a tutorial on coding classes/starting equipment might also be useful (however species is by far the most important in my opinion), sorry about that. I haven't seen that many suggestions for new classes, but I could imagine it would be an interesting thing for people to play around with, and might lead to some interesting results.)
2012 Winner of fewest proposed ideas implemented by devs.

Dungeon Master

Posts: 1531

Joined: Saturday, 5th March 2011, 06:29

Post Sunday, 24th February 2013, 22:28

Re: Indepth development guides

Adding a new player species or god is a whole lot of work and will touch a lot of different parts of the codebase. I don't know if it's really feasible to "put together a quick tutorial" that could even cover all the basics; let alone how to even begin on the more complex mechanics that will be unique to the given proposal. I also can't imagine getting a whole influx of new development as a result of this, you'd need at least a rudimentary understanding of C++ to follow such a tutorial and in that case could probably work out how to do this stuff anyway (just search all files for an existing race or god enum...). Just look at that list CommanderC posted: that's an absolute ton of files to edit just to cover the bases.

However some better code documentation / guidelines certainly wouldn't go amiss to reduce the learning curve for coders who want to get involved. And there is a good argument that some of the player and god code could use some refactoring to get this kind of stuff more centralised, but that kind of refactoring would be prohibitively difficult.

Bim

Crypt Cleanser

Posts: 700

Joined: Wednesday, 5th January 2011, 15:51

Post Sunday, 24th February 2013, 22:48

Re: Indepth development guides

mumra wrote:.......However some better code documentation / guidelines certainly wouldn't go amiss to reduce the learning curve for coders who want to get involved. And there is a good argument that some of the player and god code could use some refactoring to get this kind of stuff more centralised, but that kind of refactoring would be prohibitively difficult.


I definitely agree (from my limited C++ knowledge) on how difficult it would be - I'm certainly not suggesting that the tutorial would mean that anyone could sit down and bang out a few different species and gods with no skills/patience - I'm thinking of this as a starting point of making a basic 'no frills' species to try out things like starting with different mutations/skill sets so that those geniunely interested can see what works and what doesn't.

Mainly, I feel that some strong documentation would allow those interested enough to get their teeth stuck into it without having to grep everything and wonder if they've missed anything out/what certain things do. If this was in wiki form, others could possibly contribute to how to make other mechanics (such as making new mutations/abilities) which could eventually allow for some really great ideas to come through.

Also, lets not forget how good it is to get more people interested in coding!
2012 Winner of fewest proposed ideas implemented by devs.

Ziggurat Zagger

Posts: 6393

Joined: Friday, 17th December 2010, 18:17

Post Monday, 25th February 2013, 07:58

Re: Indepth development guides

I see it as a way set the bar higher and reduce the number of bad proposals.

Vestibule Violator

Posts: 1567

Joined: Friday, 21st January 2011, 22:56

Post Monday, 25th February 2013, 10:34

Re: Indepth development guides

I don't think it will affect the quality of proposals on GDD. Also it's fine that a lot of them are bad, so I don't think the bar needs to be raised.

But it would certainly make things a lot easier for people who are interested in coding a new species. The crawl code can be very intimidating.

Bim

Crypt Cleanser

Posts: 700

Joined: Wednesday, 5th January 2011, 15:51

Post Monday, 25th February 2013, 11:22

Re: Indepth development guides

What I was thinking about came about due to (from ages ago) a reallly, really long species thread on Golems. It went on for pages and pages about the viability of the species whilst no one was capable enough (who wasn't a dev) to put it into a prototype to test it out - and so it just fizzled out even though it had a lot of enthusiastic supporters who were just too intimidated to get stuck into coding it.

Admittedly the proposal was slightly more complicated than this tutorial would address, yet this would be a great stepping stone for enthusiastic people to 'prove' that their idea works.
2012 Winner of fewest proposed ideas implemented by devs.

Vestibule Violator

Posts: 1567

Joined: Friday, 21st January 2011, 22:56

Post Monday, 25th February 2013, 11:48

Re: Indepth development guides

Someone implemented two golem proposals. I don't know how many tried them out, but even that requires applying a patch and compiling crawl, which is not trivial, especially on windows.

Tartarus Sorceror

Posts: 1773

Joined: Monday, 21st February 2011, 15:57

Location: South Carolina

Post Monday, 25th February 2013, 13:19

Re: Indepth development guides

Grimm wrote:I see it as a way set the bar higher and reduce the number of bad proposals.

Are bad ideas in the forum really a problem?

And is everything posted in GDD supposed to be a well thought out, fully fleshed out proposal for something that really should be added to the game, or is it just a sounding board to inspire thoughts about what might be able to be part of something that could work?

I haven't read the sticky threads in more than a year, so I guess the answer to that may be there.

Personally, I don't hold back many ideas just because they aren't good. Before I knew the forum existed, I posted my bad ideas on the dev wiki. I think that was probably the wrong thing to do, but voicing bad ideas on the tavern seems mostly harmless.

Bim

Crypt Cleanser

Posts: 700

Joined: Wednesday, 5th January 2011, 15:51

Post Monday, 25th February 2013, 14:36

Re: Indepth development guides

I don't think it's too much of a problem in reality (no one HAS to read or look at them) but I find that with most ideas raised the poster (and others) want to see their idea seriously implemented/tried out, and yet none of the devs are really going to go out of their way when there are other things to do/their own ideas.

This gets frustrating for people with good ideas who haven't really got enough coding experience to know where to start from (and some of these ideas might actually be really good!) and, with adequate documentation, we could then say 'If you want it so much, why not use this tutorial to make a start?'
2012 Winner of fewest proposed ideas implemented by devs.

Ziggurat Zagger

Posts: 6393

Joined: Friday, 17th December 2010, 18:17

Post Monday, 25th February 2013, 17:45

Re: Indepth development guides

jejorda2 wrote:Are bad ideas in the forum really a problem?

I didn't put it well.

From my perspective the problem is the aggro and friction that often accrue to poor ideas. Recent example here, and another bit of GDD meanness here. Compare to the good reception that this idea got when accompanied by some hard numbers.

Making the coding requirements for all proposals clearer and more up front would possibly reduce the likelihood of personal arguments happening.

Bim

Crypt Cleanser

Posts: 700

Joined: Wednesday, 5th January 2011, 15:51

Post Monday, 25th February 2013, 18:30

Re: Indepth development guides

Couldn't agree more, over the years I've seen potentially good (even great) ideas fall apart due to arguments and personal attacks of 'NO MY IDEA IS GREAT YOU DON'T UNDERSTAND' and complete dismissal. For the most part, posters are just saying 'I have an idea that the dev's have to implement now' and not having any other avenues to go down other than learning C++ from the bottom up. That's currently too much to ask for the average poster, as it's too intimidating to get into when you see all the files and code that go into crawl.

Granted, a tutorial wouldn't fix that completely (they're still going to have to learn/work at it) but it at least means that it would be fairer to say that 'blue sky'/major ideas (not just a small tweak) need to be backed by at least an attempt at a patch/code. Obviously, if we could really get support behind tutorials, a few different aspects could be covered, so those dying for an acid spell school could attempt to show it's use, and those wanting a three armed sphinx could give that a go too.
Last edited by Bim on Monday, 25th February 2013, 19:14, edited 1 time in total.
2012 Winner of fewest proposed ideas implemented by devs.

Vestibule Violator

Posts: 1500

Joined: Monday, 3rd January 2011, 17:47

Post Monday, 25th February 2013, 19:11

Re: Indepth development guides

I'd like to see this simply because the crawl code is vast, twisty warren of passage that look alike. I'm a programmer by trade and I've gone code diving a bunch to look up specific mechanics on things in the past. At the same time, Crawl is a big, complex piece of software and any help in deciphering that is welcome. In my opinion, even with a tutorial of sorts it will take hours and hours of work to become familiar with the code base.

For this message the author rebthor has received thanks: 2
BlackSheep, Sandman25

Ziggurat Zagger

Posts: 3163

Joined: Friday, 6th January 2012, 18:45

Post Monday, 25th February 2013, 19:24

Re: Indepth development guides

I'm a bit busy to search around the dev wiki right now and am unfamiliar with the layout, but is there a page/topic on there about documenting the code base? I'm curious if anyone has started to put together an overview or vision for documenting the code.

Tomb Titivator

Posts: 799

Joined: Saturday, 23rd February 2013, 22:25

Post Wednesday, 13th March 2013, 04:22

Re: Indepth development guides

I would love this.
Personaly, what I would find most useful is a list of where everything is in the code. It's hard to add a new rod if you don't know where they're stored.
User avatar

Dungeon Master

Posts: 4031

Joined: Thursday, 16th December 2010, 20:37

Location: France

Post Wednesday, 13th March 2013, 08:03

Re: Indepth development guides

grep is your friend
<+Grunt> You dereference an invalid pointer! Ouch! That really hurt! The game dies...

For this message the author galehar has received thanks:
Grimm

Bim

Crypt Cleanser

Posts: 700

Joined: Wednesday, 5th January 2011, 15:51

Post Thursday, 14th March 2013, 09:49

Re: Indepth development guides

Grep is great, but from my own experience it's easy to miss bits and not realise all the places you need to add/adjust stuff. As Khalil said, lists of where things are and a few pointers (much like CommanderC did) would be useful. When I said indepth guide, I realise it'd be a lot of work but pretty much anything in the direction of a tutorial/list would be great!
2012 Winner of fewest proposed ideas implemented by devs.

Dungeon Master

Posts: 1531

Joined: Saturday, 5th March 2011, 06:29

Post Thursday, 14th March 2013, 11:44

Re: Indepth development guides

Bim wrote:Grep is great, but from my own experience it's easy to miss bits and not realise all the places you need to add/adjust stuff. As Khalil said, lists of where things are and a few pointers (much like CommanderC did) would be useful. When I said indepth guide, I realise it'd be a lot of work but pretty much anything in the direction of a tutorial/list would be great!


It sounds like we have a volunteer?
User avatar

Dungeon Master

Posts: 4031

Joined: Thursday, 16th December 2010, 20:37

Location: France

Post Thursday, 14th March 2013, 11:48

Re: Indepth development guides

There's some doc in doxygen format, but it doesn't have much content.
<+Grunt> You dereference an invalid pointer! Ouch! That really hurt! The game dies...

Bim

Crypt Cleanser

Posts: 700

Joined: Wednesday, 5th January 2011, 15:51

Post Thursday, 14th March 2013, 20:43

Re: Indepth development guides

As I've said, I'm happy to edit/test/sort stuff, but I'll need a bit of help getting it off the ground, because as rebthor mentioned, it's pretty huge to start digging in with. Should I start a page on the chaosforge wiki?
2012 Winner of fewest proposed ideas implemented by devs.

For this message the author Bim has received thanks:
galehar
User avatar

Dungeon Master

Posts: 4031

Joined: Thursday, 16th December 2010, 20:37

Location: France

Post Thursday, 14th March 2013, 21:47

Re: Indepth development guides

Not the chaosforge wiki. Development documentation goes on the dev wiki. You can also document directly the source using doxygen. Type make doxy-all or make doxy-simple to generate the documentation. There's no crawl specific documentation for doxygen, but I think it's relatively simple to use.
<+Grunt> You dereference an invalid pointer! Ouch! That really hurt! The game dies...
User avatar

Dungeon Master

Posts: 182

Joined: Saturday, 18th December 2010, 10:26

Location: Germany

Post Friday, 29th March 2013, 11:38

Re: Indepth development guides

galehar wrote:Not the chaosforge wiki. Development documentation goes on the dev wiki. You can also document directly the source using doxygen. Type make doxy-all or make doxy-simple to generate the documentation. There's no crawl specific documentation for doxygen, but I think it's relatively simple to use.


FWIW, I'd advise against an in-depth documentation on the wiki. Stuff like that just tends to go stale. (I remember I wrote a list of pointers once about how to add a spell as an example on how to create a patch, probably in the docs somewhere, but that's likely to be severely out of date by now.) If you do it, use the code of the most recent official release as a basis and make it clear that the tutorial only refers to that version and may not cover later versions, then update from time to time. A more recent trunk version may be tempting, but readers are much more likely to understand "version 0.13" than "revision 8dc273a5".

Doxygen would have the advantage of being easier to keep up-to-date if file names change etc. Unfortunately, the source is not set up in a way to allow for neat packaging of all relevant methods and variables in a single class or class dependencies. So someone would still have to add a list of links to the documentation on the wiki.
Does compiling Doxygen actually work now? I never could get it to work back when I tried it (which, granted, was about 3 years ago).
Please report bugs to Crawl's bug tracker, and leave feedback on the development wiki. Thank you!
User avatar

Dungeon Master

Posts: 4031

Joined: Thursday, 16th December 2010, 20:37

Location: France

Post Friday, 29th March 2013, 14:42

Re: Indepth development guides

jpeg wrote:Does compiling Doxygen actually work now?

Yes it does. I just tried and it seems to work perfectly fine.
<+Grunt> You dereference an invalid pointer! Ouch! That really hurt! The game dies...

Return to Coding

Who is online

Users browsing this forum: No registered users and 1 guest

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.