New Class
Moderator: Board moderators
Well I read that thread and I have thought of a way of changing alchemy that should achive all that was mentioned in that topic with reletive ease, and shouldn't require any changes outside of alchemy.c
In fact, the way I'm thinking of would probably be possible to make a beta form of in under 2 days of hard work.
If you have any questions on possible ways to go about doing things, feel free to ask me.
In fact, the way I'm thinking of would probably be possible to make a beta form of in under 2 days of hard work.
If you have any questions on possible ways to go about doing things, feel free to ask me.
Aaron wrote:yes, whats the best way to learn C in 1-2 hours?
maybe also a quick way to familiarize yourself with the alchemy code? and prefferably other parts of the crossfire code? then get a server up to test it? maybe a month of hard work.
- Best way to learn C fast: Tutorials such as those in that other topic. (Unless you have somebody teaching you in person, which can be potentially faster for a similar level of completeness). Though those are the best ways to learn fast you will always miss some detail or another, and the best way to deal with that IMHO is just looking such up as you need or asking others about the specific problem.
Quick way to familiarize yourself with the alchemy code: Not as easy, but the best way to start is to look for a specific part of it's behavoir that you know about from using alchemy, and find the specific peice of code that does that. Repeat, wash & rinse for all parts you're interested in.
And prefferably other parts of the crossfire code: I find that the best way is to only learn parts of the crossfire code when you're actually trying to change it, or checking if you might need to. If so, then the same procedure as above works well.
Get a server up to test it:Then change files in <pathtotestinglocation>/etc/crossfire/ to match the settings you feel like having your server.Code: Select all
./configure --prefix=<pathtotestinglocation> make make install
maybe a month of hard work? No! That can be as short as 2 days (or even 1 in ideal conditions) of hard work. Depending on how throughly you mean with learning C, and familirizing yourself with various parts of crossfire.
id like to learn enough C to acctually be able to write a decent program. looking through the code will probably take the longest. i dont know if my computer can even run the server and the client at the same time. i suspect it might just run out of ram, make a funny noise, then freeze up...
also i have stuff to do, so i wont be able to sit around 24 hours and do this. a goo dday for me would be 5 hoursish.
also i have stuff to do, so i wont be able to sit around 24 hours and do this. a goo dday for me would be 5 hoursish.
-
- Forum Fanatic
- Posts: 852
- Joined: Sun Jun 13, 2004 2:07 am
- Location: Hemel Hempstead
Once you learn C to a usable level you will then be at the same point I was a year or so ago.
Having tried myself to navigate through the source code to cf without a clear understanding of the server structure, I'll make a few brief notes here in order to hopefully speed up your attempt to do the same.
Note that you /will/ need to understand what structs and pointers are first, so either have a book on C open whilst you do this (skim it first), or learn C.
objects: everything that is on a map is of type object, objects are central to the server, everything connects to objects somehow, how important any part of the server is is mostly determined by how far away from the object code it is, include/object.h is the first thing you should read.
the objects are all in one big linked list, with smaller linked lists for special objects (eg, gods, players, pets), additionally there are pointers to nearby objects.
the objects point to a map that they are in, this provides some extra data.
objects have flags to mean special things (friendly, monster, floor, many many others).
players are a special type player, but that wraps an object (called the player object in most places)
properties of objects are loaded using lexx in loader.l
strings between objects are shared, so that dozens of swords all have the same adress used for the name sword. to cope with this a shared string library is used. the functions from this must be used when dealing with object strings, otherwise bad stuff(tm) happens.
commands are defined by a series of big arrays with function pointers to the code that implements the command.
Ignore the image code, I do, it is scary (this applies double for the image code in the clients)
and finally a rough idea of the meaning of any field in an object can be found by reading object.h (did I mention objects were important...)
when you understand objects reasonably well, pick a command that you know what it does, look for it in commands.c find the function it references and see what that does. the commands that are mostly typed tend to be simpler in nature than those that are not (eg command_shout is easier to follow than command_drop)
Anyway, after you have done all of that, try and pick something simple to do, if you don't know whether what you want to do would be simple, ask, better that you be told to hold off writing $JUMBO_PATCH that will take you weeks and be a nightmare to figure out than to start it and get discouraged when you don't understand how major bits of the server interact.
Having tried myself to navigate through the source code to cf without a clear understanding of the server structure, I'll make a few brief notes here in order to hopefully speed up your attempt to do the same.
Note that you /will/ need to understand what structs and pointers are first, so either have a book on C open whilst you do this (skim it first), or learn C.
objects: everything that is on a map is of type object, objects are central to the server, everything connects to objects somehow, how important any part of the server is is mostly determined by how far away from the object code it is, include/object.h is the first thing you should read.
the objects are all in one big linked list, with smaller linked lists for special objects (eg, gods, players, pets), additionally there are pointers to nearby objects.
the objects point to a map that they are in, this provides some extra data.
objects have flags to mean special things (friendly, monster, floor, many many others).
players are a special type player, but that wraps an object (called the player object in most places)
properties of objects are loaded using lexx in loader.l
strings between objects are shared, so that dozens of swords all have the same adress used for the name sword. to cope with this a shared string library is used. the functions from this must be used when dealing with object strings, otherwise bad stuff(tm) happens.
commands are defined by a series of big arrays with function pointers to the code that implements the command.
Ignore the image code, I do, it is scary (this applies double for the image code in the clients)
and finally a rough idea of the meaning of any field in an object can be found by reading object.h (did I mention objects were important...)
when you understand objects reasonably well, pick a command that you know what it does, look for it in commands.c find the function it references and see what that does. the commands that are mostly typed tend to be simpler in nature than those that are not (eg command_shout is easier to follow than command_drop)
Anyway, after you have done all of that, try and pick something simple to do, if you don't know whether what you want to do would be simple, ask, better that you be told to hold off writing $JUMBO_PATCH that will take you weeks and be a nightmare to figure out than to start it and get discouraged when you don't understand how major bits of the server interact.
Very well said cavesomething.
I would add that with the new code forum, you can post a question to see how difficult something would be, and get some general hints/ideas from other people who have looked at the code before starting on it.
Of course, you could also look for some help there if you got stuck.
I would add that with the new code forum, you can post a question to see how difficult something would be, and get some general hints/ideas from other people who have looked at the code before starting on it.
Of course, you could also look for some help there if you got stuck.
K&R is the best for itAaron wrote:id like to learn enough C to acctually be able to write a decent program.
but you need to, you have to make your changes in it...Aaron wrote:looking through the code will probably take the longest.
it will do it. i've done it on a celeron 400 and i didn't stop all daemons. it's just compilation take a bit more timeAaron wrote: i dont know if my computer can even run the server and the client at the same time. i suspect it might just run out of ram, make a funny noise, then freeze up...
hey, make it at your own rythm. there's no supervisor here ! 1 day, 10 days, 30 days, no mater.Aaron wrote:also i have stuff to do, so i wont be able to sit around 24 hours and do this. a goo dday for me would be 5 hoursish.