You must be logged in to post messages.
Please login or register

Modding and Scripting
Moderated by Yeebaagooon, nottud

Hop to:    
loginhomeregisterhelprules
Bottom
Topic Subject: MazZa's BIG Data guide: Part 1, an introduction to C++
« Previous Page  1 2  Next Page »
posted 16 November 2004 01:20 AM EDT (US)   
Data guide Download Status

Accept/Decline

Data guide Accepted

AN INTRODUCTION TO C++

C++ is the system that programmers use to make their games and programs. They are made up of a system of various files and applications.

  • The Executable file (EXE)
  • The dll Definition files

    these are the main ones and the others are just expanding definitions of these.

    There are lots of great programs that can be used in the c++ scheme but here are some handy ones

    PE EXPLORE is a very handy tool to navigate a exe or dll - it has the same princible as resource hacker but it is slightly better, this however is a trial so let the 30 days you have count

    You will also want a C++ Complier which is availible here This is probably the best free c++ complier that you can get for free. Not even a trial.

    --------------------------------------------------------

    This guide is presented like a course. This course is intended as a first introduction to programming computers using the C++ programming language. It is not assumed that the student has done any programming before hence this course is not comprehensive and does not cover all of C++. In particular it does not cover any of the object-oriented features of C++, these are introduced in the following course (Introduction to Computing II). Because this is a first programming course emphasis is placed on the design of programs in a language-independent fashion. A brief introduction to computers is also given.

    Before considering the programming of a computer a brief overview of the basic structure of a Computer in terms of its main components is given. Every Computer has the following general structure:
    [BMP, (141.73 KB)]

    Take a minute to think of how that is your computer System.

    When a computer obeys the instructions in a computer program it is said to be running or executing the program. Before a computer can execute a computer program the program must be resident in memory. The program must occupy a set of consecutive bytes in memory and must be written in the internal machine language for the computer. Each CPU has its own machine language which means that before a program can be executed on another CPU it has to be re-written in the internal machine language of the other CPU.
    The concept that the program to be executed is stored in the computer memory is an important one. This is what makes the computer such a general-purpose problem-solving machine -- merely by changing the program stored in memory the computer can be used to carry out an entirely different task.
    Once the program is loaded into memory then the following sequence is carried out:

    set instruction address to the address of
    the first instruction
    while program not finished
    {
    fetch instruction from current instruction address
    update current instruction address
    execute the fetched instruction
    }

    This sequence is usually called the fetch-execute cycle.

    This hole process is done by executable files or EXE files.

    all computers have an internal machine language which they execute directly. This language is coded in a binary representation and is very tedious to write. Most instructions will consist of an operation code part and an address part. The operation code indicates which operation is to be carried out while the address part of the instruction indicates which memory location is to be used as the operand of the instruction. For example in a hypothetical computer successive bytes of a program may contain:

    operation
    code address meaning
    00010101 10100001 load c(129) into accumulator
    00010111 10100010 add c(130) to accumulator
    00010110 10100011 store c(accumulator) in location 131

    where c( ) means `the contents of' and the accumulator is a special register in the CPU. This sequence of code then adds the contents of location 130 to the contents of the accumulator, which has been previously loaded with the contents of location 129, and then stores the result in location 131. Most computers have no way of deciding whether a particular bit pattern is supposed to represent data or an instruction.
    you always have to keep careful track of which locations they are using to store data, and which locations are to form the executable program. Programming errors which lead to instructions being overwritten with data, or erroneous programs which try to execute part of their data are very difficult to correct. However the ability to interpret the same bit pattern as both an instruction and as data is a very powerful feature; it allows programs to generate other programs and have them executed.

    The Operating System of a computer is a large program which manages the overall operation of the computer system. On a simple one-user computer the Operating System will:

    Provide an interface to allow the user to communicate with the computer. This interface may be a text-oriented interface where the user types commands in response to a prompt from the computer or may be a mouse-driven Windows operating system.
    Control the various peripherals e.g. Keyboard, Video Display Unit (VDU), Printer etc. using special programs called Device Drivers.
    Manage the user's files, keeping track of their positions on disk, updating them after user makes changes to them etc. An important facility that the Operating System must supply in this respect is an Editor which allows users to edit their files.
    Provide system facilities, e.g. Compilers to translate from high-level programming languages used by the user to the internal machine language the computer uses.

    It is very necessary to have a Complier to translate all the aspects of this because the high level language is near illegable.

    Now if you intend to use th c++ and you computer is linked (LAN) then you might have trouble. If you do get back to me and I will give you a step by step guide on what the terms are and how you might be able to face them.

    Now we have the main program datbase to speculate (How you would go about creating a computer program

    There are various steps involved in producing a computer program for a particular application. These steps are independent of which computer or programming language that is used and require the existence of certain facilities upon the computer. The steps are:

    Study the requirement specification for the application. It is important that the requirements of the application should be well specified. Before starting to design a program for the application it is necessary that the requirement specification is complete and consistent. For example a requirement specification that says `write a program to solve equations' is obviously incomplete and you would have to ask for more information on `what type of equations?', `how many equations?', `to what accuracy?' etc.
    Analyse the problem and decide how to solve it. At this stage one has to decide on a method whereby the problem can be solved, such a method of solution is often called an Algorithm.
    Translate the algorithm produced at the previous step into a suitable high-level language. This written form of the program is often called the source program or source code. At this stage the program should be read to check that it is reasonable and a desk-check carried out to verify its correctness. A programmer carries out a desk-check by entering a simple set of input values and checking that the correct result is produced by going through the program and executing each instruction themselves. Once satisfied that the program is reasonable it is entered into the computer by using an Editor.
    Compile the program into machine-language. The machine language program produced is called the object code. At this stage the compiler may find Syntax errors in the program. A syntax error is a mistake in the grammar of a language, for example C++ requires that each statement should be terminated by a semi-colon. If you miss this semi-colon out then the compiler will signal a syntax error. Before proceeding any syntax errors are corrected and compilation is repeated until the compiler produces an executable program free from syntax errors.
    The object code produced by the compiler will then be linked with various function libraries that are provided by the system. This takes place in a program called a linker and the linked object code is then loaded into memory by a program called a loader.
    Run the compiled, linked and loaded program with test data. This may show up the existence of Logical errors in the program. Logical errors are errors that are caused by errors in the method of solution, thus while the incorrect statement is syntactically correct it is asking the computer to do something which is incorrect in the context of the application. It may be something as simple as subtracting two numbers instead of adding them. A particular form of logical error that may occur is a run-time error. A run-time error will cause the program to halt during execution because it cannot carry out an instruction. Typical situations which lead to run-time errors are attempting to divide by a quantity which has the value zero or attempting to access data from a non-existent file.
    The program must now be re-checked and when the error is found it is corrected using the Editor as in (3) and steps (4) and (5) are repeated until the results are satisfactory.

    The program can now be put into general use - though unless the testing was very comprehensive it is possible that at some future date more logical errors may become apparent. It is at this stage that good documentation produced while designing the program and writing the program will be most valuable, especially if there has been a considerable time lapse since the program was written.

    these terms dont just go for making new programs but also for applications that we will branch off AOM


    So that is an intro duction to the c++. the guide is made up of 5 parts this is just an intro. the following guides are going to be on how you relate these things to AOM and other related things. But for now play around with a c++ complier.

    I support Visual C++ as a good complier so I would download it.

    But now is time for some questions - I am quite experienced so I might be able to answer all your questions - and if not I have connections who might be able to help me to help you.

    Glossary

  • Accumulator, this is a branch of a system - a capicitator of sorts. Think of a accumulator as say a battery.

  • Complier, Compliers translate the high c++ to a clearer form.

  • Syntax errors, Errors that occur - they can be frusterating if you dont know what to do or how to go about fixing them - If you are a Gmax user you will know how much of a pain these can be.


    [This message has been edited by Treebeard III (edited 11-16-2004 @ 01:42 AM).]

  • Replies:
    posted 16 November 2004 01:28 AM EDT (US)     1 / 34  
    Well here it is - an intro to my big data guide - this is really important. Just to get into the feel of C++ later on in the course will will link this to aom and you will be able to create all your wishes - even the god picker. So read this and get a felel how th machine works and how the executable system may fire and do - any questions or understanding would be graciously answered

    Once again if you use Lan then you WILL have problems with this, because seeing how you CPU is linked then you will not have full Andmistration over all the machines.

    posted 16 November 2004 02:03 AM EDT (US)     2 / 34  
    I'd rather have a programmer to help me with my project rather than learn it. Can you join my project team. Its not a design team just a team to make project scorch.
    Register at my forums if you want to join.
    I just need a template with some things I can't yet add and of course I would love to be able to make new attach points.

    [This message has been edited by scorpion ra (edited 11-16-2004 @ 02:07 AM).]

    posted 16 November 2004 02:06 AM EDT (US)     3 / 34  
    Ok but this is good to learn

    Hey wait I am in tasmainia - your in sydney - that means we are both is EST.

    our time zones are the same.

    I will join then.

    [This message has been edited by Treebeard III (edited 11-16-2004 @ 02:07 AM).]

    posted 16 November 2004 02:09 AM EDT (US)     4 / 34  
    I thin I've already got my hands full with 3d modelling, drawing and texturing.
    posted 16 November 2004 02:17 AM EDT (US)     5 / 34  
    Oh thats cool - your models are great though.

    Well I will let you in in my current project.

    I am creating a .max to .brg converteer. and I am looking into the attachpoints. Applying a 3ds dosent work so I may need to make a new model file and tach aom to execute it - may naver happen but the converter will be done.

    posted 16 November 2004 02:19 AM EDT (US)     6 / 34  
    Anybody know where I can get a free C++ Complier that will work on win98 se.

    I do have a question for ya though treebeard. How do you link your new exe with aom fso it will fire as well when opening the game...what specific code do I need.

    Ohh and when will the rest of the guide be released.


    £¿ïþß첩û £¤® ~ ¿ïØûîÐ £í® §üÐ줧
    Ô¿ÿmþîåñ §â££ ã §ÅÇ
    Gravity is a myth, the Earth sucks.
    posted 16 November 2004 02:30 AM EDT (US)     7 / 34  
    @Treebeard: I've already started a beast master unit that is ready for export. Its still in pieces but it has all the basic things we need to fix. It needs the hitpoint bar lowered and also needs a new attachpoint for a gp sfx and right hand for his knife/food.
    Here's a screenie:

    [This message has been edited by scorpion ra (edited 11-16-2004 @ 02:31 AM).]

    posted 16 November 2004 02:36 AM EDT (US)     8 / 34  
    Ok I have joined
    posted 16 November 2004 02:38 AM EDT (US)     9 / 34  
    Ok so you're the new member. I sent you a pm because I wasn't sure so ignore it.
    posted 16 November 2004 01:39 PM EDT (US)     10 / 34  

    Quote:

    MazZa's BIG Data guide:


    lol what happened to my copyright?

    hmm this guide will sure come handy, well in


    Leader of Liquid Fire. Animator Seb C.

    One does not simply leave HG
    posted 16 November 2004 04:34 PM EDT (US)     11 / 34  

    Quote:

    the best free c++ complier that you can get for free


    Free c++ compliers dont tend to be free?

    I think FOG.
    posted 16 November 2004 07:30 PM EDT (US)     12 / 34  
    Actually, that's probably one of the worst compilers. It's made by Microsoft, after all.

    Dev-C++ is a much better one if you're using Windows. Easy to download. Easy to use. And it uses gcc as it's compiler.


    Dnas
    Wildfire games 0 A. D. texture artist.
    Rest In Peace, Flipbizcut (1979-2005)

    [This message may have been edited by Dnas (edited 49-92-4096 @ 42:93 PM).]

    posted 16 November 2004 07:46 PM EDT (US)     13 / 34  
    gcc does tend to rock.

    Where be your gibes now? your gambols? your songs?
    Your flashes of merriment, that were wont to set the table on a roar?
    Not one now, to mock your own grinning?
    posted 16 November 2004 11:48 PM EDT (US)     14 / 34  
    Dev is cool - aswell.

    Visual c++ is however prety dam good.

    Now With the hitpoints bar I have on alternative.

    I can delete the bar of the unit and you can add a similar bar to the mesh at the required level. then in the anim we can use damage logic and replace texture.

    posted 17 November 2004 00:12 AM EDT (US)     15 / 34  
    Alright... downloading Dev-C++ right now. Thanks guys fo the help...BTW...any body try out the version 5 bete yet...just wondering if it is stable or not...getting v4 atm.

    God I hate having win98...all the new programs require 2000 or xp...stupid ferver microsoft.


    £¿ïþß첩û £¤® ~ ¿ïØûîÐ £í® §üÐ줧
    Ô¿ÿmþîåñ §â££ ã §ÅÇ
    Gravity is a myth, the Earth sucks.
    posted 17 November 2004 00:32 AM EDT (US)     16 / 34  
    How would the new hp bar rotate with the camera if its part of the model?
    posted 17 November 2004 01:06 AM EDT (US)     17 / 34  
    Nice, how about that mod-tool now?
    posted 17 November 2004 01:35 AM EDT (US)     18 / 34  
    Ok I donwloaded a compiler and the pe explorer...Now how does the pe explorer help in reading the exe so I can find this loop hole you talk about...In other words how is this suppost to work...Dont need to learn c++ due to already know...erm...well kinda lol...enough to get by atleast. So spill the beans treebeard. Only got 30 days till this pe explorer demo is done with ya know.

    £¿ïþß첩û £¤® ~ ¿ïØûîÐ £í® §üÐ줧
    Ô¿ÿmþîåñ §â££ ã §ÅÇ
    Gravity is a myth, the Earth sucks.
    posted 17 November 2004 02:24 AM EDT (US)     19 / 34  
    Rightio let me introduce you guys to PE Explorer.
    Well PE Explorer lets you deeply navigate an executable.

    Its awsome and this program helped me experience some great modding break throughs.

    Ok here is a cool intro for ya flip.

    open up PE Explorer and then open up aom.exe

    the click this icon

    on the side you will see a list.
    this has all the imported dlls and exe files that are run with aom - the aom system is cheifly from the aomx.exe.

    some of these may be hidden so you can sve them from the file.

    You can also import a custom dll into the list - so it will run with aomx.exe and in fact aom its self.

    also take the time to look at the exports.
    these are the files that are exported with the executable. this is cool when it comes to navigating dll files
    so that answers flip question

    [This message has been edited by Treebeard III (edited 11-17-2004 @ 02:27 AM).]

    posted 17 November 2004 04:38 AM EDT (US)     20 / 34  
    Hey man thanks...Now think I got a grasp on what you mean by multiple exes firing with the aom.exe. I think that is lol.

    £¿ïþß첩û £¤® ~ ¿ïØûîÐ £í® §üÐ줧
    Ô¿ÿmþîåñ §â££ ã §ÅÇ
    Gravity is a myth, the Earth sucks.
    posted 17 November 2004 03:51 PM EDT (US)     21 / 34  
    Is there meant to be some acknowledgement of this source?
    posted 17 November 2004 06:58 PM EDT (US)     22 / 34  
    Or any other source for that matter.

    I'm getting annoyed at the fact that you are basically claiming the "discovery" of C++ for youself.
    While you have some forumers here (such as me) who have been coding in C++ for almost 4 years. And I'm certain Ykkrosh has been coding even longer than that.


    Dnas
    Wildfire games 0 A. D. texture artist.
    Rest In Peace, Flipbizcut (1979-2005)

    [This message may have been edited by Dnas (edited 49-92-4096 @ 42:93 PM).]

    posted 17 November 2004 08:20 PM EDT (US)     23 / 34  
    yay! it's here

    Smiley faces are your friends. Hippies are your friends. Hobos are your friends. Why don't we just say everyone and everything is your friend?
    posted 18 November 2004 02:52 AM EDT (US)     24 / 34  
    Yibbidy Yibbida.

    I shouda posted the url but yeah - this is just to introduce you on how to use c++ and stuff I didnt write it. Oh and I didnt discove c++ I just love it

    posted 18 November 2004 03:52 AM EDT (US)     25 / 34  
    Plagerism is illegal, you know.


    You can't just copy and paste stuff and claim it to be your own guide.

    The text in your document is exactly the same as in the link Ykkrosh gave.


    Dnas
    Wildfire games 0 A. D. texture artist.
    Rest In Peace, Flipbizcut (1979-2005)

    [This message may have been edited by Dnas (edited 49-92-4096 @ 42:93 PM).]

    « Previous Page  1 2  Next Page »
    Age of Mythology Heaven » Forums » Modding and Scripting » MazZa's BIG Data guide: Part 1, an introduction to C++
    Top
    You must be logged in to post messages.
    Please login or register
    Hop to:    
    Age of Mythology Heaven | HeavenGames