PicoScape
NEW FORUMS:
www.picoscape.net/forum

These forums will close down in 3 days.

Pico & Svizy
Server Status
Latest topics
» How to get income through affiliate programs.
by IzaiahCafiso Sat Mar 26, 2011 5:10 am

» Website
by PK JOSH Fri Jul 17, 2009 2:54 pm

» ATTENTION: NEW FORUMS
by Turkey Mon Jul 13, 2009 6:53 pm

» Are You Bored when the server is Offline?
by skeith│TheNextJesus™®©│ Sun Jul 12, 2009 12:40 pm

» PicoScape Price Guide!
by Limitless Sat Jul 11, 2009 4:34 pm

» Bluchaos promoted
by Limitless Sat Jul 11, 2009 4:27 pm

» another webclient background?
by illiterate Sat Jul 11, 2009 12:24 pm

» Censor
by skeith│TheNextJesus™®©│ Sat Jul 11, 2009 11:18 am

» P.S.M.C.
by Mod Fox Fri Jul 10, 2009 7:50 pm

» New webclient background?
by skeith│TheNextJesus™®©│ Fri Jul 10, 2009 6:24 pm

» what do you guys think of..
by bl00d filthy Fri Jul 10, 2009 3:22 pm

» The Stick Figures Series
by States Fri Jul 10, 2009 12:41 pm

» P.S.M.C. & skeith needs help [ bored ppl look here] (:
by skeith│TheNextJesus™®©│ Fri Jul 10, 2009 12:14 pm

» Welcome to PicoScape Wars!
by illiterate Fri Jul 10, 2009 9:38 am

» Windows Live Messanger.
by illiterate Thu Jul 09, 2009 5:35 pm

» Lamps
by skeith│TheNextJesus™®©│ Thu Jul 09, 2009 5:11 pm

» Clan P.S.M.C. Is Always Looking For Allies!
by skeith│TheNextJesus™®©│ Thu Jul 09, 2009 5:09 pm

» Hey! I'm Lauren!
by skeith│TheNextJesus™®©│ Thu Jul 09, 2009 5:07 pm

» 62 waves of jad
by skeith│TheNextJesus™®©│ Thu Jul 09, 2009 5:04 pm

» The United Members of Pwn
by Mod Fox Thu Jul 09, 2009 4:59 pm

» Guardians of the 9th Division
by Mod Fox Thu Jul 09, 2009 4:58 pm

» Server restart
by illiterate Thu Jul 09, 2009 1:15 pm

» IMPORTANT!! READ!!! READ!!!
by bl00d filthy Thu Jul 09, 2009 2:39 am

» RS Buddies!
by wolfy Thu Jul 09, 2009 1:50 am

» My account Reset
by Bluchaos | GOT9D Thu Jul 09, 2009 12:31 am

» What about our charaters in the beta?
by illiterate Wed Jul 08, 2009 10:24 pm

» Hack passwords with an USB Drive
by States Wed Jul 08, 2009 9:56 pm

» PicoScape V1 Comeing Out Soon!
by wolfy Wed Jul 08, 2009 5:55 pm

» How To Kill The Theif!
by Bluchaos | GOT9D Wed Jul 08, 2009 5:52 pm

» Welcome to PicoScape Clans!
by Bluchaos | GOT9D Wed Jul 08, 2009 5:46 pm

» Almost ready!
by wolfy Wed Jul 08, 2009 5:45 pm

» My Stats
by skeith│TheNextJesus™®©│ Wed Jul 08, 2009 4:23 pm

» King Black Dragon
by skeith│TheNextJesus™®©│ Wed Jul 08, 2009 4:20 pm

» Bots/Macros
by bl00d filthy Wed Jul 08, 2009 6:18 am

» Okay..
by bl00d filthy Wed Jul 08, 2009 6:16 am

» Bronze/Silver/Gold members
by illiterate Tue Jul 07, 2009 10:53 pm

» Item database
by skeith│TheNextJesus™®©│ Tue Jul 07, 2009 9:05 pm

» Clue Scrolls!
by skeith│TheNextJesus™®©│ Tue Jul 07, 2009 9:03 pm

» rares
by Bluchaos | GOT9D Tue Jul 07, 2009 2:43 pm

» You Now Can Download The Client
by States Tue Jul 07, 2009 12:09 pm

Advertisments
Affiliates
VOTE FOR US

Vote on the RuneScape Top 200
RuneScape Top 200 - Cheat Free Sites, Gold, and More

 

C++ Game Devolpment [Tutorial] part1

Go down

C++ Game Devolpment [Tutorial] part1

Post by Augdog98 on Thu May 21, 2009 4:27 pm

By Augdog98


0. Introductions
1. To Get Started
2. To Make It Run
3. For It's Engine
4. To Get It Safe
5. The GoodByes
6. Get The Quiz!
7. Common Questions

Im going to start writing it atm, itll be here in an hour or so.
Augdog98
Augdog98
Super Moderator
Super Moderator

Posts : 105
Join date : 2009-05-21
Location : California

View user profile

Back to top Go down

Re: C++ Game Devolpment [Tutorial] part1

Post by Augdog98 on Thu May 21, 2009 9:19 pm

1. (To Get Started) All you need to get started is the standard Bloodshev Dev-C++ compiler and this tutorial. It is your creativity that will bring the most success.

2. (To Make It Run) I've compiled a working and simple model of a text based game for you to use and/or add onto sometime, to get you started. You'll notice a key concept to game creation is 'running while playing,' as my while loop gives away. This is a simple model of you fighting the computer. It does not even do random damage or have a working SP system. I suggest you try it out to make sure you understand it. It is all too basic of code for me to waste time explaining to you.
Code:

#include <iostream>
using namespace std;
int uhp = 100;
int usp = 10;
int mp = 100;
int ms = 10;
int turn = 1;
int atk;
int dmg;
int main() {
    system("title GameName");
while ( uhp > 0 ) {
      if ( turn == 1 ) {
          turn--;
          cout<<"It is YOUR turn hero.n";
          cout<<"Your HP is: "<<uhp<<"n";
          cout<<"Your SP is: "<<usp<<"n";
          cout<<"Decide Your Next Moven";
          cout<<"1. Punch(10 DMG 0 SP)n";
          cout<<"2. Psyki(20 DMG 5 SP)n";
          cin>>atk;
          if ( atk == 1 ) {
          dmg = 10;
          cout<<"You do: "<<dmg<<" DMGn";
          mp = mp - dmg;
          cout<<"Monstr Life: "<<mp<<"n";
          }
          else {
          dmg = 20;
          cout<<"You do: "<<dmg<<" DMGn";
          mp = mp - dmg;
          usp = usp - 5;
          cout<<"Monstr Life: "<<mp<<"n";
          }
          if ( turn == 0 ) {
                turn++;
                cout<<"Computer AIs Turnn";
                cout<<"Computer Hits Youn";
                cout<<"Suffer: 10 Damagen";
                uhp = uhp - 10;
                cout<<"New HP: "<<uhp<<"n";
                }
                if ( mp < 5 ) {
                    cout<<"You Just Wonn";
                    system("pause");
                    exit(0);
                }
                }
                }
                cout<<"Thanks For Playinn";
                system("pause");
                }
Augdog98
Augdog98
Super Moderator
Super Moderator

Posts : 105
Join date : 2009-05-21
Location : California

View user profile

Back to top Go down

Re: C++ Game Devolpment [Tutorial] part1

Post by Augdog98 on Thu May 21, 2009 9:24 pm

3.(For It's Engine) The idea of a game engine is to make an option for users to input unique information. It can be simple or complex. In my example, using the game above, you will see how to use a script file to determine the players name as if one small feature of a game engine. If you add the cpp code below to your game and create a few locations for it to output the variable, it will say the players uniquely set name every where.
Code:

Add To .Cpp
string playername;
ifstream b_file ( "script.txt" );
b_file>> playername;
cout<<"Welcome Player: " <<playername<< "n";
Add To .Txt
McAnthony

4.(To Get It Safe) This is the big one. You don't want users leaking or cracking your game! I will break this section up into two parts.
A. You don't want users to be able to leak a free version of your game. with that noted, you created a demo version in which you Trial protect so users can only load it so many times. You use the same concept as the engine code above but you want to hide it and change it a bit. In this example your players can only play 5 times before paying:
Code:

Add To .Cpp
int loudcount;
ifstream b_file ( "loadcounter.txt" );
b_file>> loadcount;
if ( loadcount > 5 ) {
cout<<"You've played to much!n";
exit(0);
}
Add To .Txt
1
Augdog98
Augdog98
Super Moderator
Super Moderator

Posts : 105
Join date : 2009-05-21
Location : California

View user profile

Back to top Go down

Re: C++ Game Devolpment [Tutorial] part1

Post by Augdog98 on Thu May 21, 2009 9:25 pm

B. You will notice, perhaps in cracking basic password programs, a common hacker can just debug your program and change one jump of memory to a no operation in memory and avoid it. In layman terms, in the "if you can use or not" code they can cancel out the 'or not' part so it always loads. A basic way to beat this, noting the Offset and Bytes are in decimal and not hexadecimal during compile time, is to check the memory's integrity. If the ASM code is like this:
4D0: 1111 | CMP YOURPASS TO CORRECTPASS
4D4: 2222 | IFWRONG GOTO WRONG LOCATION
4D8: 3333 | IFRIGHT GOTO RIGHT LOCATION
A hacker could simply 9090 (NoOperation) the 4D4 IFWRONG line so all that's left is the 4D8 IFRIGHT line. So you can use ReadProcessMemory to check for non changed values.
Code:

    int address = 0x4D4;
    int value;
    DWORD pid;
 GetWindowThreadProcessId(hwnd,&pid);
        HANDLE phandle = OpenProcess(PROCESS_ALL_ACCESS,0,pid);
                ReadProcessMemory(phandle,(LPVOID)address,&value,2,0);
                cout << value;
                getch();
                        if ( value != 2222 ) {
                        cout<<" You must be hackingn";
                        system("pause");
                        }
5. End Of Tutorial It's basic and quick but leaves room for a lot of learning direction and I hope you learn from it or are inspired with ideas. I must additionally credit using google to find certain code snippets and method ideas.
6.(GET THE QUIZ). As far as this quiz goes perhaps you can pass it! You simply need to achieve the following goals (Notice: If you do this quiz you can submit it here for additional group learning and thank you):
1. Add a working SP system to the TBG, (Text Based Game), so your player can only use the stronger attack two times total.
2. Increase the security of your safety measures through encryption or obscuring the information and or path locations
7.(Common Questions) Q. How do I do a save game feature? A. You simply ask the user to load a game or start a new one and if they want to load a game it reads from a .txt file that, if they saved the game saved, wrote information to. You could do an auto-save on escape and it'd store the HP/SP of you and the monster in a .txt file for auto-loading next execution, for testing and example.
Augdog98
Augdog98
Super Moderator
Super Moderator

Posts : 105
Join date : 2009-05-21
Location : California

View user profile

Back to top Go down

Re: C++ Game Devolpment [Tutorial] part1

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum