The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Creative Discussions > Game Development > Scripts & Tutorials
Sign Up Rules/FAQ Live Battle Blogs Mark Forums Read

Notices

Scripts & Tutorials This forum is for scripts and code, as well as all kinds of tutorials, software, tools and so forth. Remember to give credit!
The thread revival limit does not apply here.


Reply
Click here to go to the first staff post in this thread.  
Thread Tools
  #126    
Old June 29th, 2013, 08:36 PM
DarkPsychic's Avatar
DarkPsychic
 
Join Date: Jul 2012
Gender: Male
This looks very interesting
I have just started to learn programming through C from a very great site called computerscienceforeveryone.com
So far I am still in the basics but am wondering how long it took you to learn C#?
and how easy is it going from C to C#?
Another question I have is why not use C++, wouldn't that be more efficient?

I ask because I came across a page on the net named "Why pokemon is so buggy" so I clicked and read on and it goes to say that the gb/gbc/gba games are programmed entirely in Assembly and that its amazing that they even work as the difference in ASM to C is quite significant.

Spoiler:
BECAUSE IT IS WRITTEN IN ASSEMBLY.
Most commercial games for the Game Boy were written in assembly. This is because it is much more efficient than compiled C programs for that platform. For those of you who have no idea what I’m talking about, assembly can be written in binary. Think about that for a second. These programmers were writing basically the 1s and 0s that were being executed on the Game Boy’s puny Z80 processor.
Most code nowadays is written in higher-level programming languages such as C and C++. They sort of look like English. This sorta-English is compiled, which means it is turned into assembly for whatever processor you want to run it on. Every processor, be it Intel’s x86 architecture, IBM’s PowerPC, or the Cell processor all have their own assembly languages, or instruction sets. So you can write a program in C and use different compilers to turn your C code into assembly for whatever processor you’re going to be using. The Game Boy’s was a stripped-down Zilog 80.
At any rate, compilers, while usually pretty good about making optimized machine code, aren’t perfect and when you have extremely scare resources, like on the Game Boy, you need a human to do the instruction-level optimization. Unfortunately, this is like building a house out of twigs. You can do it, but it will be hard, take a long time, will be really easy to screw up, and the result will be easy to break.
Let’s compare something really simple: Hello World.
In C:
/* Hello World program */
#include<stdio.h>
void main()
{
printf("Hello World");
}
Pretty self-explanatory, right? This will print the words “Hello World" to the screen.
In Game Boy Assembly (this is an EXCERPT, full program is here):
; ********************************************************
; Main code:
; Print a character string in the middle of the screen
; ********************************************************
ld hl,Title0
ld de, _SCRN0+1+(SCRN_VY_B*5) ;
ld bc, Title0End-Title0
call mem_CopyVRAM

ld hl,Title1
ld de, _SCRN0+6+(SCRN_VY_B*8) ; spaced over
ld bc, Title1End-Title1
call mem_CopyVRAMv
This does the same thing, but instead of just asking for a built-in function to print a string to the screen for you, you have to load each individual letter from memory (which you have to fill yourself), and call a whole separate function to copy your characters into video memory so it can draw it on the screen for you.
So already you can see there is a lot a compiler does for you.
Also remember that that huge chunk of code could, if you really wanted to, be written in 1s and 0s.
Now let’s talk about Pokemon.
Imagine a game as vast as Pokemon being written in this fashion. Every time you want to add two numbers together, you have to load them into registers from memory, add them, and stick them back into memory. Think about what it takes to draw sprites on screen, talk to NPCs, load up the Pokedex, play music, and generate random encounters.
Armed with this knowledge, I think it’s incredible that Pokemon works at all.
Reply With Quote
  #127    
Old June 30th, 2013, 04:56 AM
Varion Bluefire's Avatar
Varion Bluefire
A.K.A The Glitch
 
Join Date: Apr 2013
Age: 19
Gender: Male
Nature: Naughty
Send a message via Skype™ to Varion Bluefire
Quote:
Originally Posted by oxysoft View Post
Sorry but no. A good portion of the engine related to entities and the map would have to be reprogrammed and reworked.
So, not even if they new an excessive amount of C#?
__________________
Reply With Quote
  #128    
Old July 3rd, 2013, 12:02 PM
oxysoft's Avatar
oxysoft
 
Join Date: Sep 2009
Quote:
Originally Posted by DarkPsychic View Post
This looks very interesting
I have just started to learn programming through C from a very great site called computerscienceforeveryone.com
So far I am still in the basics but am wondering how long it took you to learn C#?
and how easy is it going from C to C#?
Another question I have is why not use C++, wouldn't that be more efficient?

I ask because I came across a page on the net named "Why pokemon is so buggy" so I clicked and read on and it goes to say that the gb/gbc/gba games are programmed entirely in Assembly and that its amazing that they even work as the difference in ASM to C is quite significant.

Spoiler:
BECAUSE IT IS WRITTEN IN ASSEMBLY.
Most commercial games for the Game Boy were written in assembly. This is because it is much more efficient than compiled C programs for that platform. For those of you who have no idea what I’m talking about, assembly can be written in binary. Think about that for a second. These programmers were writing basically the 1s and 0s that were being executed on the Game Boy’s puny Z80 processor.
Most code nowadays is written in higher-level programming languages such as C and C++. They sort of look like English. This sorta-English is compiled, which means it is turned into assembly for whatever processor you want to run it on. Every processor, be it Intel’s x86 architecture, IBM’s PowerPC, or the Cell processor all have their own assembly languages, or instruction sets. So you can write a program in C and use different compilers to turn your C code into assembly for whatever processor you’re going to be using. The Game Boy’s was a stripped-down Zilog 80.
At any rate, compilers, while usually pretty good about making optimized machine code, aren’t perfect and when you have extremely scare resources, like on the Game Boy, you need a human to do the instruction-level optimization. Unfortunately, this is like building a house out of twigs. You can do it, but it will be hard, take a long time, will be really easy to screw up, and the result will be easy to break.
Let’s compare something really simple: Hello World.
In C:
/* Hello World program */
#include<stdio.h>
void main()
{
printf("Hello World");
}
Pretty self-explanatory, right? This will print the words “Hello World" to the screen.
In Game Boy Assembly (this is an EXCERPT, full program is here):
; ********************************************************
; Main code:
; Print a character string in the middle of the screen
; ********************************************************
ld hl,Title0
ld de, _SCRN0+1+(SCRN_VY_B*5) ;
ld bc, Title0End-Title0
call mem_CopyVRAM

ld hl,Title1
ld de, _SCRN0+6+(SCRN_VY_B*8) ; spaced over
ld bc, Title1End-Title1
call mem_CopyVRAMv
This does the same thing, but instead of just asking for a built-in function to print a string to the screen for you, you have to load each individual letter from memory (which you have to fill yourself), and call a whole separate function to copy your characters into video memory so it can draw it on the screen for you.
So already you can see there is a lot a compiler does for you.
Also remember that that huge chunk of code could, if you really wanted to, be written in 1s and 0s.
Now let’s talk about Pokemon.
Imagine a game as vast as Pokemon being written in this fashion. Every time you want to add two numbers together, you have to load them into registers from memory, add them, and stick them back into memory. Think about what it takes to draw sprites on screen, talk to NPCs, load up the Pokedex, play music, and generate random encounters.
Armed with this knowledge, I think it’s incredible that Pokemon works at all.
1. I learned C# in about a month before I started this project. I already had background in Java though.

2. I don't know C, can't tell you. C is not object-oriented while C++/C# are, however.

3. Only the first Pokemon games on the gameboy may have been written in Assembly. They were written in C/C++ afterwards on the advance. Also this article inaccurate: the first games (red, blue etc.) were not "buggy", the games were playable without any bugs. It's just that people found a large amount of ways to exploit the way the game works and the slow processor (Pokemon duplicating etc.) Just about any gameboy game is "buggy" like pokemon is, it's just that Pokemon has many more well known glitches than any other games.

Also, A lot of these exploits weren't found until decompiling the game and inspecting how it behaves.

The large list of glitch Pokemon is only due to getting pokemons above the id #151 which would result in reading garbage data and interpret it as a Pokemon. The garbage data is no longer read in more recent games because the language take cares of memory management and such itself.
__________________
PokeSharp Engine
Reply With Quote
  #129    
Old July 4th, 2013, 01:13 PM
DarkPsychic's Avatar
DarkPsychic
 
Join Date: Jul 2012
Gender: Male
Quote:
Originally Posted by oxysoft View Post
1. I learned C# in about a month before I started this project. I already had background in Java though.

2. I don't know C, can't tell you. C is not object-oriented while C++/C# are, however.

3. Only the first Pokemon games on the gameboy may have been written in Assembly. They were written in C/C++ afterwards on the advance. Also this article inaccurate: the first games (red, blue etc.) were not "buggy", the games were playable without any bugs. It's just that people found a large amount of ways to exploit the way the game works and the slow processor (Pokemon duplicating etc.) Just about any gameboy game is "buggy" like pokemon is, it's just that Pokemon has many more well known glitches than any other games.

Also, A lot of these exploits weren't found until decompiling the game and inspecting how it behaves.

The large list of glitch Pokemon is only due to getting pokemons above the id #151 which would result in reading garbage data and interpret it as a Pokemon. The garbage data is no longer read in more recent games because the language take cares of memory management and such itself.
I see... I am currently learning C at the moment, it is my first programming language. How much more do you have to do before releasing a beta for testing?
Reply With Quote
  #130    
Old July 29th, 2013, 11:08 AM
YourNobody's Avatar
YourNobody
 
Join Date: Jul 2006
Location: Minnesota, USA
Age: 29
Gender: Female
Nature: Quirky
I was wondering when someone would finally just make a Pokemon game maker. It would certainly make things a lot easier. Pokemon Essentials is neat and all, but it does feel a bit forced and cluttered. It's not Maruno's fault. It's like building a table with a screwdriver and nails. Sure, it can be done, but it's not at all efficient. A hammer is a better tool for nails.

Here's hoping that this project gets off the ground. I'm really liking what I'm seeing so far. It's like if RPG Maker was made only for Pokemon games. Nothing wrong with that. I approve, since I know very little about scripting, so if you can mimic RPG Maker's event system, I would be right at home.
Reply With Quote
  #131    
Old July 29th, 2013, 01:14 PM
oxysoft's Avatar
oxysoft
 
Join Date: Sep 2009
Quote:
Originally Posted by YourNobody View Post
I was wondering when someone would finally just make a Pokemon game maker. It would certainly make things a lot easier. Pokemon Essentials is neat and all, but it does feel a bit forced and cluttered. It's not Maruno's fault. It's like building a table with a screwdriver and nails. Sure, it can be done, but it's not at all efficient. A hammer is a better tool for nails.

Here's hoping that this project gets off the ground. I'm really liking what I'm seeing so far. It's like if RPG Maker was made only for Pokemon games. Nothing wrong with that. I approve, since I know very little about scripting, so if you can mimic RPG Maker's event system, I would be right at home.
I'm not sure whether or not I want to spend the time yet for a RPG Maker type of event system considering it would take me quite some time to do, let alone figuring out how to structure it. It's not like writing scripts would be hard but anyway.
__________________
PokeSharp Engine
Reply With Quote
  #132    
Old July 29th, 2013, 01:26 PM
YourNobody's Avatar
YourNobody
 
Join Date: Jul 2006
Location: Minnesota, USA
Age: 29
Gender: Female
Nature: Quirky
Oh, so scripting knowledge is required? Okay, I guess that's good to know.
Reply With Quote
  #133    
Old July 29th, 2013, 03:11 PM
lauerolus's Avatar
lauerolus
 
Join Date: Mar 2013
Gender: Male
RMXP's ease of movement/text/variable control is very spoiling. Being able to just click when to warp is awesome too.

I just played around with FireRed again and it's damned easy now to do stuff now(like expanding the movetable + special/physical split. Did it in twenty minute with the tutorials.) but RMXP is so easy to use I can't bring myself to switch. The people who've worked on Pokemon Essentials have made it so easy a child(like 8) could make a working fangame. It'd be short and terrible, but you could play it.

That and editing the AI/Abilities in RMXP will be much easier.

Last edited by lauerolus; July 29th, 2013 at 03:16 PM.
Reply With Quote
  #134    
Old July 29th, 2013, 03:17 PM
oxysoft's Avatar
oxysoft
 
Join Date: Sep 2009
Quote:
Originally Posted by lauerolus View Post
RMXP's ease of movement/text/variable control is very spoiling. Being able to just click when to warp is awesome too.

I just played around with FireRed again and it's damned easy now to do stuff now(like expanding the movetable + special/physical split. Did it in twenty minute with the tutorials.) but RMXP is so easy to use I can't bring myself to switch. The people who've worked on Pokemon Essentials have made it so easy a child(like 8) could make a working fangame. It'd be short and terrible, but you could play it.

That and editing the AI/Abilities in RMXP will be much easier.
Right, well then I'll see what I can do.
__________________
PokeSharp Engine
Reply With Quote
  #135    
Old August 4th, 2013, 01:31 AM
oxysoft's Avatar
oxysoft
 
Join Date: Sep 2009
pokesharp.com has be bought and we will have a teaser page up very soon! Some may say it's a little early for thinking about the site, and I will agree to some extent, but my good friend's hosting company provides us with free hosting and he really wanted to get it all setup already. We just have to pay for the domain every years which is like only 10$. My friend also paid for the domain this time. He will take care of everything that is code related to the site. I am very grateful to him and we should all be.

On a more pokesharp related note, I am working on 2 things at the same time right now which is tile behaviors, otherwise known as the movement permission layer in advance map, and an in-game console that will let you send commands to the engine to debug and stuff.

Some specifications about the permission layer in this engine that is different than advance map:

1. Ice, low ledges (up,down,left,right), tall grass, spinning (up,down,left,right) etc. all constitute their own behavior unlike advance map where an ice tile will always be slippery. Not only does that allow for more jerkish puzzles (an ice tile that's actually no ice in a ice puzzle, omfg) but it also works on the concept that if it's slippery ice, then you can obviously walk on it and should not be made unpassable, making it less error prone to mapping errors.

2. You can specify default movement behaviors to your tiles in the tileset tab of the database window. These default behaviors will be applied onto the movement permission layer when laying tiles on the map, minimizing the need of actually having to make edits to the permission layer. Such edits should only be needed when multiple heights have to be supported.

3. Heights work exactly like in advance map, i.e: you set height change tile behaviors onto stairs and set the height higher on the terrain using the tile permission for a higher height. The player will not be able to go from one height to another.

Writing this post made me realize that I cannot keep tile behaviors and height behaviors on the same permission layer because one may want to actually have ice on a higher height. I will separate the 2 later. In most cases it shouldn't cause problems though.

On a side note, I installed mediawiki on the site so I can prepare a couple of articles until release. I also spent a few hours to learn the basics of HTML and CSS so I can make nice looking articles, though I'm sure one of you guys is a massive CSS or mediawiki nerd here and will know how to organize the wiki. The wiki is available at pokesharp.com/wiki/ I feel like I'm gonna regret not keeping it private for now.

edit:

I added a neat little feature on 2 tools for now

Spoiler:




It will give a preview of the affected tiles for bucket tool when you hover over tiles and the rectangle tool will show the changes in real time rather than just showing a rectangle around the affected region

I uploaded a video demonstrating it on my channel as well
__________________
PokeSharp Engine

Last edited by oxysoft; August 5th, 2013 at 11:43 AM.
Reply With Quote
  #136    
Old August 16th, 2013, 10:48 PM
zingzags's Avatar
zingzags
Creator or Pokemon Serenity
 
Join Date: Jan 2009
Location: Boston
Age: 20
Nature: Adamant
@Oxysoft, from Maplestory section on RZ to PokeSharp on PC.
__________________
Pokemon Serenity is my fangame name.
name decided 12/15/09
Currently helping:
Pokemon ebony
and
Xenotime:
Reply With Quote
  #137    
Old August 17th, 2013, 10:13 AM
oxysoft's Avatar
oxysoft
 
Join Date: Sep 2009
Project is on hold for a week or two:

doing warmup game for next 5 days or so then ludum dare!
__________________
PokeSharp Engine
Reply With Quote
  #138    
Old August 17th, 2013, 10:37 AM
Whitney's Shaymin's Avatar
Whitney's Shaymin
Creator Of Pokemon Grace
Community Supporter
 
Join Date: Apr 2012
Location: Goldenrod, Johto
Gender: Male
Nature: Timid
Cool, can't wait to see this happen. I wanna make a game for XNA!
__________________


"The Incredibly Pretty Girl"

Gym Leader Whitney
link | link | link

FC: 4699-7156-4669 IGN: Gavin
Reply With Quote
  #139    
Old August 17th, 2013, 05:54 PM
SinfulGuroRose's Avatar
SinfulGuroRose
Ignore me, I'm socially inept.
 
Join Date: Aug 2013
Location: U.S.A.
Age: 18
Gender: Female
Nature: Bashful
From the previews you've put up so far, this looks like not only a well designed tool, but also user friendly! o: I'm very excited to see this unfold.
(Also, the website is absolutely adorable! <3 Love it!)
__________________
-shape.memory.music-

Reply With Quote
  #140    
Old August 26th, 2013, 04:40 PM
\/'s Avatar
\/
Grey Cat
 
Join Date: Aug 2013
Gender: Male
Quote:
Originally Posted by pokemoner2500 View Post
Cool, can't wait to see this happen. I wanna make a game for XNA!
I thought Microsoft wasn't supporting it anymore?
Reply With Quote
  #141    
Old August 28th, 2013, 09:20 AM
oxysoft's Avatar
oxysoft
 
Join Date: Sep 2009
I am stopping development of PokeSharp. For more details, check out this post I made on my subreddit http://www.reddit.com/r/PokeSharp/co...at_the_moment/
__________________
PokeSharp Engine
Reply With Quote
  #142    
Old August 28th, 2013, 10:47 AM
Maruno's Avatar
Maruno
Lead Dev of Pokémon Essentials
 
Join Date: Jan 2008
Location: England
It's a shame to hear that. You're very kind for releasing your source code, though; I'll definitely be having a look at that at some point.

Would you care to provide a short summary of what you've already achieved with your engine?
__________________
Reply With Quote
  #143    
Old August 28th, 2013, 08:52 PM
KingCharizard's Avatar
KingCharizard
C++ Developer Extraordinaire
 
Join Date: Dec 2009
Location: Pennsylvania
Age: 25
Gender: Male
Nature: Bold
Quote:
Originally Posted by oxysoft View Post
I am stopping development of PokeSharp. For more details, check out this post I made on my subreddit http://www.reddit.com/r/PokeSharp/co...at_the_moment/
I read your reasons and I gotta say if you love programming then programming anything would be fun, not boring. Also I find it kinda silly and rude that you would abandon the project after someone else bought you a domain and set up a site.

Also Pokemon has many complicated features that I'm sure you have not programmed or completed, I think many of your reasons for dropping the project are left out..

Its sad to see you quit, and quitting now could become a habit in the future.. Anyways good luck in whatever else you decide to do.
__________________
My personal website. UPDATED 8/29/2013
Reply With Quote
  #144    
Old August 29th, 2013, 02:48 AM
oxysoft's Avatar
oxysoft
 
Join Date: Sep 2009
Quote:
Originally Posted by KingCharizard View Post
I read your reasons and I gotta say if you love programming then programming anything would be fun, not boring. Also I find it kinda silly and rude that you would abandon the project after someone else bought you a domain and set up a site.

Also Pokemon has many complicated features that I'm sure you have not programmed or completed, I think many of your reasons for dropping the project are left out..

Its sad to see you quit, and quitting now could become a habit in the future.. Anyways good luck in whatever else you decide to do.
Coding the actual engine was very fun. It was the development tool that was crap boring. Many programmers can tell you that windows form are not fun to work with. I know the site guy well enough, he doesn't really mind because he pretty much swims in money. He bought like 3 graphics card worth 1000$ each for his rig just because he can.
__________________
PokeSharp Engine
Reply With Quote
  #145    
Old August 29th, 2013, 05:01 PM
dexter1o6
 
Join Date: Jul 2013
Age: 26
Gender: Male
So, you need a challenge with some mathematics in it. That can be arranged. To make the product of this challenge useful, it will have to fit in Pokemon Essentials though...

Challenge:

You know that there is a random dungeon creating thing in Pokemon Essentials? What if you were to expand it? Make it create whole maps, maybe regions, by clicking a button! The good thing about this is that the owner of the map doesn't even know the contents himself...

Features:
- Connectivity: Make sure the roads are connected! It would be annoying if you can't reach a specific part of the town... Water and trees may have to be connected too, see also my point of aggregation.
- Make the user set the density of houses, tall grass patches, water, trees, etc.
- Groups of houses may form towns, groups of trees may form forests: will the distrubution of the different attributes be aggregated, or equally spread out? There will have to be a parameter for the user to be set for each attribute available: high aggregation of house will lead to big cities, low aggregation of houses will lead to small villages. The same goes for trees and their forests.

To make this work right, you will need to dig into some spatial modelling stuff, and mathematics can't be avoided. Plus, I think there are many people who would gladly make a game in a diverse map/region randomly created, unique, and unknown! On top of that, creating a map would only take some time to render, let's say, 20 minutes or so and a whole region is done...
Reply With Quote
  #146    
Old March 18th, 2014, 06:54 PM
WAS's Avatar
WAS
 
Join Date: Mar 2014
Location: Seattle
Gender: Male
Nature: Serious
What's the status on this engine? I see that all related material online has been removed besides screenshots. Any particular reason? I have been interested in starting a game off of a unique engine. Been itching to get back into sprite work and RPG games.
__________________
Reply With Quote
  #147    
Old March 19th, 2014, 01:19 AM
dragonnite
pokemon ranger rank 10
 
Join Date: Dec 2009
Location: 5cm meters from somthink with an IDE
Gender: Female
Nature: Calm
Hmm i like this. One question will there a use of reflection for makeing scripts and dynmic objects
__________________


Reply With Quote
Reply
Quick Reply

Sponsored Links
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Minimum Characters Per Post: 25



All times are UTC -8. The time now is 12:58 AM.


Style by Nymphadora, artwork by Sa-Dui.
Like our Facebook Page Follow us on Twitter © 2002 - 2014 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2014 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.