C++ :: How To Code AI For RTS Games
Oct 13, 2013I want to make a RTS game but how can I code an AI for RTS games. How to do that?
View 5 RepliesI want to make a RTS game but how can I code an AI for RTS games. How to do that?
View 5 RepliesHow I can make 2D games in OpenGL. I have sprites, but when I load them in game, they're all big and stuff, not pixel for pixel how I'd like them. How can I do this?
View 16 Replies View RelatedRight, I'm making a game and I'm not sure how I'm going to do this:
On Skyrim (for example; there are thousands of others), when you equip a helmet, it appears on your character's mesh.
How do they do that? Do they modify the mesh, or simply render the helmet at a location which makes it look like it is on their head, or what?
I have assignment which requires me to print out and array code and a pseudo code. I dont no what a pseudo code is,.
View 2 Replies View RelatedI have a class 'A' which is almost perfect for my needs. Class 'B' uses class 'A' I've now designed Class 'C' and Class 'D' and noticed that there is a good chunk of code in class 'B', 'C' and 'D' for using Class 'A' is duplicated. I've separated out this code in specific, standalone functions in each of the classes. Now I'm wondering where this code should go. At the moment, the functions are duplicated in the three calling classes (B, C and D). Placing the functions into class 'A' would break the single responsibility principle. Inheritance to add functionality would likely break both SRP and LSP. The one that seems that it may work is composition.
However, Is designing a complete class just for a few functions over kill?
Would it be valid for classes 'B', 'C' and 'D' to access both the new class 'E' (which would depend on A) and the old class 'A' (which would have to be the same instance as the instance in the new class 'E'), or should the new class 'E' provide sufficient functionality so that Classes B, C and D don't need to access Class A directly? It would seem that its then an incomplete interface of the original object with additional functionality (ie, incompatible) Or should I do it a completely different way?
i wrote the following code :
Code:
#include<stdio.h>#include<conio.h>
#include<stdlib.h>
int a[][4] = {15,9,10,25,6,2,4,7,32,19,42,8,21,17,18,0};
void boxes();
void display();
void main()
{int ch,r=3,c=3,t;
[Code]...
not able to esc when i press esc key.how to get rid of this.
I wanna to know how can i get a string from the user and treat it as a c++ code ..is there any way to do that ??
View 7 Replies View RelatedI am making a game and want to make an updater that grabs the source code from a page on the web. Can this use things that are available to all platforms? It could just be something that grabs the text from the page and executing it (maybe using something like Python's exec() command ?) BTW I'm using mac
View 1 Replies View Relatedthis is my code i want to put the part where i have it do multiplication and addition into functions. and then call them so that it can run the addition and multiplication. Heres my code
# include <iostream>
using namespace std;
int main(){
[Code].....
I'm pretty new to C++ and I'm on Binary Trees in "Jumping into C++"! I've just created a DLL project on Code::Blocks, and I cannot get it to build and run: "You must select a host application to "run" a library..." is the message that I'm getting when I run the main code file. It's had no changes to it (except for a few extra, unnecessary line feeds), and it's the file which Code::Blocks generates on a DLL project.
View 13 Replies View Relatedwhats wrong with this code, I'm trying to parse a .js file and replace all the ";" with "; " i.e add a new line after each ";". So I load the file into a char[] buffer then assign a string to this contents of this buffer. Then loop char by char through using an iterator and check for a ";", if found use replace. So int i gets to about 85898 then crashes with unknown error, 'i' should reach about 175653. It does work up till it crashes. And, is this not a simpler way to load a file into a buffer, there is in C.
Code:
#include <iostream>
#include <fstream>
#include <algorithm>
#include <vector>
#include <stdlib.h>
int main()
[code]....
I have a function that needs to return a "uint8_t" value. However before doing the processing I need to perform a test on the argument to check if it's between expected boundaries. Although this function works it gives (a logical) warning that not always a value is returned although expected. What is the normal way for functions like these where I normally should return e.g. -1 in case the test doesn't succeed and otherwise the uint8_t (t) value?
Code:
uint8_t myFunc(int a) {
if (a >= 0 && a <= 100) {
// Perform actions
uint8_t = ...
return t;
}
}
I have a code that I'd like to debugg it.
Question
1 - What is the correct command line to use the debugger ?
2 - Do I need to install additional software for the debugger ?
if yes what it's name?
I use ububtu 12.4compiling command: gcc abc.c -lpthread -o abc
I am using windows 64 bit 2007 , codeblocks and ive tried googling on how to strip all symbols to binary so that the people i send it to cannot read the game files but ive not found anything much... How do i do it on codeblocks..? Code:
View 4 Replies View RelatedI've had with visual studio but nothing seems to be working. No matter what I do even with simple programs, like Hello World, I'm always getting an error about a .pch header file.fatal error C1083: Cannot open precompiled header file: 'DebugConsoleApplication1.pch': No such file or directory
This is only for one of the programs I've made but I'm pretty new to programming and I've not even used the header files for anything so I have no clue how to resolve this problem.
I want the 'counter' loop to go through twice, each time reading in 15 characters from the standard input, then going through the evalutor
Code:
#include <stdio.h>
#include <ctype.h>
int main (void)
{
char inputtedhand[64];
int NumC=0, NumD=0, NumS=0, NumH=0;
}
[code]...
I am in try to use PlPlot library (for plotting) in C with code::blocks IDE (ver 10.05) on windows-7 plateform. I downloaded "plplot-5.9.9.tar" and unzipped it. In documentation it is not very clear to me (I am not expert in using third party lib.), how this library can be used with code::blocks i.e. where I have to save the lib, what should be added in compiler and debugger settings etc. It also seems from document that "makefile" (linux type!!) is necessary for Windows also? I am also unaware of MSYS makefile generator (given on Wiki page) on windows?
View 2 Replies View Related i recently started programming. i mean I've been exposed to programming for the first time about a week ago. I've been following the tutorial here and playing around with my own code. For some reason, this code works while receiving decimals but not fractions.
Code:
#include <stdio.h>
int main()
{
float kd;
float kd_2;
printf("Please enter your k/d
");
scanf("%f", &kd );
}
[code]....
I want to start developing Android apps in C++, but I do not know what I could use to compile the source code into an apk. I know that C++ is probably not the best choice for Android development, but I already know it and I do not want to learn Java.
View 4 Replies View RelatedI was trying to make boost's serialization use less bytes, and I stumbled upon this, which removes the big debugging symbols:
strip --strip-debug
or
strip -w -K '!*serialization*'
This seems like a working command on msys, but how to implement this into code blocks.
for example i have
int count = t1;
while(count>counter){
Sleep(delay);
Int32::TryParse(textBox2->Text,add);
result = result + add;
counter = counter + 1;
Problem is that sleep stops all program for specified time, Is there an alternative to sleep that would only stop part of code or can i use sleep different way to specify what it pauses?
Is there a way to change the Font size using code?
View 5 Replies View RelatedI am a database developer and I am assigned with a task to finish it as someone left it in the middle.The number 1406357289 ,is a o to 9 pandigital number because it is made up of each of the digits of 0 to 9 in some order,using each digit only once, but it also has a rather interesting sub-string divisibility property. Let d1 be the 1st digit,d2 be the 2nd digit, and so on.In this way,we not the following;
d2d3d4=406 is divisible by 2
d3d4d5=063 is divisible by 3
d4d5d6=635 is divisible by 5
d5d6d7=357 is divisible by 7
d6d7d8=572 is divisible by 11
d7d8d9=728 is divisible by 13
d3d4d5=289 is divisible by 17.
Find the sum of all 0 to 9 pandigital numbers with this property.
This has happened before, when I try to run a code it will say "blah.exe has stopped working" and I would have to change the code in some way to make it work.
View 1 Replies View RelatedI have to write a code that converts a hexadecimal value to a decimal value.So far I have
#include <iostream>
#include <cmath>
#include <string>
using namespace std;
int num;
char g;
int rem;
int main(){
cout << " input num: "; cin >> num;
[code]....
I think i need to put the g and rem value into a string... which I'm not sure how to do since g will be a char value and rem will be a int value... and after I believe i need to then flip the numbers in the string.. oh it has to be in the format of 0000
I'm trying to modify a library of a code and do not know exactly how to do it.I'm modifying the .cpp file and I know (as I have read on the internet) that I should compile it to obtain the .a file, because the main.cpp uses the .a file.I have written in the terminal the following command (founded on the internet):gcc -o analysis.hpp -c analysis.cpp but I still get an error.
View 3 Replies View Related