Page 16 of 47
PostPosted: 10 Nov 2009, 14:43
by xzaz
Very nice! Do you guys already thought of building the TCP / UDP sockets / clients for networking or is that a step to far ahead?
Memory leaks are a pain in the ass in every game, great you fixed it! Do you guys use call by reference or call by value?
PostPosted: 12 Nov 2009, 10:22
by Lewin
Very nice! Do you guys already thought of building the TCP / UDP sockets / clients for networking or is that a step to far ahead?
I've heard of a free, open source game networking library but I can't remember what it was called. It would probably be easier to use something like that rather than writing our own protocols from the ground up. We haven't really thought about it yet, I think we'll do the AI first, (or a least a basic AI) but it will eventually have a multiplayer mode.
Memory leaks are a pain in the ass in every game, great you fixed it! Do you guys use call by reference or call by value?
It depends on what it is. If it's just a number then it's call by value, but if it's an object, for example a unit or a house then it is by reference. (because objects have lots of values inside them) That's why it's call object oriented programming.

The problem only occurred because lots of things were keeping pointers to units/house objects that would become invalid if they were destroyed. For example, the delivery queue would keep a pointer to the house that is being delivered to, but if the house was destroyed before the serf got there then it would crash. So now it waits until the serf abandons the task before it destroys the house object. 8)
PostPosted: 15 Dec 2009, 20:47
by Krom
I'm working on Save/Load now. It works out pretty nice for terrain so far
Lewin keeps on working on unit-unit and unit-obstacle interaction.
PostPosted: 23 Dec 2009, 14:29
by Krom
Save/Load almost working now, there are number of bugs, but it works fine for smaller maps

Will need to go through code with memory leak detector.. btw main code size reached 816kb today (41700lines of code)

PostPosted: 30 Dec 2009, 21:27
by Xmasjos
I've been watching you guys for almost half a year now. I like this project and I too know some things about coding, because I'm doing a study about software developing.
Can I see (and maybe use) your code? If I understand it as much as I hope, I might be able to help with this project.
PostPosted: 01 Jan 2010, 02:44
by Lewin
The source page has been officially released, check out this page: (please continue discussion of source related things here)
http://www.atfreeforum.com/knights/viewtopic.php?p=6876
Please contact us if you feel you can contribute to the project. Have you used Delphi or Pascal before?
Feel free to use the algorithms in your own project, but please let us know first.
PostPosted: 01 Jan 2010, 14:49
by Xmasjos
I have made some simple things in Delphi, so I know the basics. I hope I can contribute to this project, because I can learn very much about these sort of things.
Thanks for the code!
PostPosted: 02 Jan 2010, 01:59
by Xmasjos
What development environment do you guys use? I can't find any free Delphi environments anymore and I don't like to download illegal software.
PostPosted: 02 Jan 2010, 10:17
by Krom
We use:
- Delphi6 (standard edition without any addons),
- OpenGL (headers file included in the project),
- OpenAL (included as well),
- ZLib (included)
- FastMM (to detect memory leaks, included as well)
- thats all I can remember atm
So, all you'll need OpenGL and OpenAL drivers installed (see Remake's readme). As for Delphi6 - it's harder to get. Ask your friends, maybe someone has it on top shelf unused.
PostPosted: 02 Jan 2010, 18:19
by xzaz
Strange language delphi looks alot like c..
PostPosted: 02 Jan 2010, 19:54
by harold
No it doesn't
PostPosted: 02 Jan 2010, 22:34
by Xmasjos
Delphi doesn't even look a little bit like c. They look like eachother because they are both programming languages. Furthermore they are totally different. I know a little bit about both, so I should know (I don't allways know everything :p)
I have laid my hands on a free version of Delphi 7. I hope it is compatible enough to use.
Do you two use a SVN-client for delphi or do you use something like tortoise? I understand many of the code, so I think I can help a little with the project when I have time, and I will have time. I will first see what I can do for this project.
PostPosted: 02 Jan 2010, 22:46
by xzaz
Maby that is because i don't know C and i dont know Delphi, wierd things are wierd things.
Is there any reason why you guys chose for Delphi and not for the c fam?
PostPosted: 03 Jan 2010, 00:22
by Xmasjos
Delphi is a lot easier to use. Thats the most easy reason I can think of.
I can't get the project running easily. Tomorrow I'm going to try to get it working tomorrow. It is allready 1.20 and I have to be in church at 9.40.
PostPosted: 03 Jan 2010, 07:42
by Lewin
Is there any reason why you guys chose for Delphi and not for the c fam?
Your assumption seems to be that C is a superior language or something. They are different, but I don't believe that either is the better language to use for the project. Either would do the job fine. Why did you assume C would be better? Also you assume that programmers can write in any language. I know very little about C, so I would have to learn the language before I could program in it. (I think Krom is the same)
I don't want to get into a "which language is better" argument but I'll give you a few reasons why I like Delphi, NOT why it is better than C: (new reincarnations of C might have all these things anyway, I don't know)
- I like the class structure which allows for child classes that inherit the parent's properties. (e.g. we can have TKMUnit, which is never used its self but then splits into TKMUnitSerf and TKMUnitWarrior which splits into TKMUnitWarriorMelee, etc. allowing for common code/properties to be shared easily)
- The debugger is really powerful (once again, I assume newer C IDEs are like that too)
- The strict type and class definitions means that little bugs such as wrong type usage are found when compiling not during run time.
- It is the language I know best (followed by PHP)
Delphi is a lot easier to use. Thats the most easy reason I can think of.
Why do you say it's easier to use? It is a higher level language than straight C but with C++ and C#, I don't know that it is any more.
The real reason is because that is what know how to program in. We never considered doing it in any other language because Delphi is what we know best. (becoming really comfortable with a language takes a long time)
I can't get the project running easily. Tomorrow I'm going to try to get it working tomorrow. It is allready 1.20 and I have to be in church at 9.40.
I don't think it will run properly in Delphi 7, lots of things changed as far as I know. See if you can get a copy of Delphi 6. Let us know how it goes though, see if you can get it to compile.
We use Tortoise SVN, which works really well as far as I've seen.