Dueal's Posts
Nairaland Forum › Dueal's Profile › Dueal's Posts
1 2 3 4 5 6 7 8 9 10 11 12 13 14 (of 14 pages)
I wish someone could tear-off this thread. Who's arguing 'bout xp and vista. WINDOW, LINUX, MAC, BeOS, Amiga, Use whatever! and SHUT-UP!!! |
I have to disagree with the fortran preacher about fortran being the most efficient language for technical computing and parallel processing. Try LISP or better Ada95 which the US Department of defence initiated, just that gives u an idea of what it can do. And i'm still not for the 'Plumbers' (strict Java users). |
@chuckz4real. Ah! So u having problems writing code. I'm sure the fault is not VB but that u haven't actually gotten the concept of programming and the different styles supported like Object-oriented programming. My advice is search the web and if u r really Seeking u will Find. |
//call this function to create a block of color. void createColorBlock(Uint32 color, int x, int y, float width, float height) { if (x + width > SDL_GetVideoSurface()->w) { y += 5; //place on next grid. x = 5; } //create rect accorinding to current spec. SDL_Rect rect = {x,y,width,height}; //draw in memory. SDL_FillRect(SDL_GetVideoSurface(),&rect,color); } Do remember to link with SDLmain.lib & SDL.lib files. So that i don't leave out some of us who haven't gotten into programming with C++ i'll also talk about something i was going to leave till next time. A very important aspect of developing games or any creative work is the DESIGN document. We all get the temptation of jumping right into a creative endeavour without taking time to plan out a strategy. This is natural but dangerous and we need to practice patience in developing an attitude towards designing first cos it helps burn out unrealistic ideas when exposed to the 'hot' investigative light. A GAME DESIGN DOCUMENT is a kinda blueprint that shows the plan of the game been created. It tells what's going to be in the game and what won't. This document is so important cos with the excitement that can happen while u r implementing the game u might keep on adding stuff to the game even when it doesn't fit thereby making u run around like a 'blind man' and never get the game finished. You'll have to put down stuff like, the story line and goal of the game, the genre of the game (action-arcade, strategy, puzzle, platform or a hybrid of the others), your target audience (kids, teens, dads & mums), what the game view will be (bird eye view, 1st person, 3rd person), and alot of other game specific issues like budget. With ur design document done u need to get the necessary resources like a game engine, people power (unless u r going the journey alone!), content creation tools like a modeller & image processing software, a programming language compiler/interpreter and so on (call this ur R& process). Later people!NB: place these image files in the executable's directory after converting them to BMP format.
|
Welcome everyone, here's another week thank God. Now, i hope we all had the chance to get the SDL library?, GOOD! Well, what's it for u might ask. SDL (Simple Direct-Media Layer) is a low-level lib for the game developer. It helps build cross-platform game code and gives API's to a systems video, sound, cd-rom, and input hardware (all a game developer needs!). Also if u know the OpenGL (Open Graphics Library) specification, SDL is able to create an OpenGL context (kinda a 'hardware format') for the creation of 3d media. Wow! I'll b posting a lil code snip' demonstrating the use of SDL here: /* * Test code to demonstrate the use of the SDL library. * This Source is open for modification. * Play&Code games. * NB: Remember to link with the SDLmain.lib and SDL.lib*/ #include "SDL.h" #include <iostream> //predefined colors usable by createColorBlock function. enum Colors { Red = 0xff0000, Green = 0x00ff00, Blue = 0x0000ff, Lime = 0x66ff00, Sky = 0x9966ff, Pinky = 0xff6699, White = 0xffffff, Orange = 0xff9900 }; void createColorBlock(Uint32 hexColor, int x, int y,float width = 150,float height= 150); int main(int argc, char * argv[]) { using namespace std; if (SDL_Init(SDL_INIT_VIDEO) < 0) { cout << SDL_GetError(); SDL_Quit(); return -1; } char * gameTitle = "sdl application window."; int screenWidth = 650, screenHeight = 480; int bpp = 32; Uint8 flag = SDL_SWSURFACE | SDL_ANYFORMAT; //load game logo. SDL_Surface * icon = SDL_LoadBMP("open-source-icon.bmp" ;//test is the load was a success. if (icon != 0) SDL_WM_SetIcon(icon, 0); else { SDL_Quit(); return -1; } //create video surface. SDL_Surface * screen = SDL_SetVideoMode(screenWidth,screenHeight,bpp,flag); SDL_Surface * image = 0; //test if we got the screen created. if (!screen) { //video memory initialization failed for some reason. cout << SDL_GetError(); SDL_Quit(); } SDL_WM_SetCaption(gameTitle,gameTitle); SDL_Event evt; bool quit = false; //button state indicators. bool CTRL_Pressed = false; bool SHIFT_Pressed = false; bool M_Pressed = false; bool P_Pressed = false; bool showCursor = true; bool previousCursorState = true; while (!quit) { while (SDL_PollEvent(&evt)) { switch (evt.type) { case SDL_QUIT: quit = true; break; case SDL_KEYDOWN: if (evt.key.keysym.mod == KMOD_LCTRL || evt.key.keysym.mod == KMOD_RCTRL) //mode key pressed. //change state of button indicators the handle in corresponding game events CTRL_Pressed = true; if (evt.key.keysym.sym == SDLK_m) M_Pressed = true; if (evt.key.keysym.sym == SDLK_p) P_Pressed = true; if (evt.key.keysym.sym == SDLK_p) P_Pressed = true; if (evt.key.keysym.sym == SDLK_w) { if (previousCursorState == true) { showCursor = false; } else { showCursor = true; } } if (evt.key.keysym.sym == SDLK_ESCAPE) //quit application with ESC key. quit = true; break; case SDL_KEYUP: if (evt.key.keysym.mod == KMOD_LCTRL || evt.key.keysym.mod == KMOD_RCTRL) //mode key pressed. //change state of button indicators the handle in corresponding game CTRL_Pressed = false; if (evt.key.keysym.sym == SDLK_m) M_Pressed = false; if (evt.key.keysym.sym == SDLK_p) P_Pressed = false; break; } //handle the game corresponding events here. if (M_Pressed && CTRL_Pressed) { //take action here. } else { //take opposite action here. } if (M_Pressed) { //take action here. } else { //take opposite action here. } if (P_Pressed) { //take action here. } else { //take opposite action here. } } SDL_ShowCursor(showCursor); if (argc > 1) { //get image file name on load of application. image = SDL_LoadBMP(argv[1]); } else image = SDL_LoadBMP("open-source.bmp" ;//put image in video memory. SDL_BlitSurface(image,0,screen,0); //create the block centered on the screen. //you can change the color of the block by using any of the predefined color codes in hex. createColorBlock(Orange, (screen->w / 2) - (150 / 2), (screen->h / 2) - (150 / 2)); createColorBlock(Red, (screen->w / 2) - (75 / 2), (screen->h / 2) - (75 / 2), 75, 75); //upate the screen window. SDL_UpdateRect(screen,0,0,screenWidth,screenHeight); } //application ending. SDL_FreeSurface(image); SDL_FreeSurface(icon); SDL_Quit(); return 0; } |
@dammytosh. If u're looking for a ref where Gosling dised his Java u won't find one cause he's bound to promote it by sun (he's not as 'brave' a Stroustrup to admit it). There was this combined interview of Ritchie,Stroustrup,& Gosling i read, on what the think about there languages. Gosling was quite defensive of his Java. Here's the link: http://www.gotw.ca/publications/c_family_interview.htm . Well, i myself won't us an AK47 to smack a roach (lol). Like u, i agree that thought should be given b4 using any language 4 a job based on the systems requirement. HAPPY CODING BRO. |
@ibo. Ur lectura wicked oh! Sorry i can't help but i'm sure my great gran-pa can. Just kiddin. Someone will show u jst b patient. |
@dammytosh. I'm sure if u were to grab the .java file for that swing GUI class and go through its declaration tree u'll land on a C/C++ code. I'm not against reusing someone elses code but i won't blindly pop this and pop that into my system just cause it's there for use without knowing how it affects my program (that's what strict Java followers do). Plumbers! Can u tell me of one widely known PC program that's in use and is written in pure java? Even SUN microsystems did not use Java for their Solaris OS cause it won't keep-up.I agree java has its place but real programming can't be done with it. It has simplistic network access classes but i'll rather go with Python sockets class. Why? Cause it's efficient written in C/C++. And about writing a 100 line source to get a window up, i don't have to cos i can get Qt3,SDL,wxWidget,ogre3d libs and create my lil class i can reuse or use the systems as is just in d same way that u get swing/AWT GUI class but the difference is mine is efficient cause i'm not blindly having a GC (garbage collector) that eats my CPU clock cycle. I'm not against using any language,funny i know java but why use something the designers won't use. I'm sure if J Gosling was give Shekpe to drink an got high he'll admit he wrote Java 4 his toddler to play with (he guards Java like it's the Holy grail of programming languages calling it a general purpose language instead of strictly a non-general application level one). Dammytosh try building a system that engages graphics algorithm and see how it runs. |
@solomon201. The reason C++ doesn't sell in nigeria is cause our so call software development companys work wit niija mentality of 'Money today today' like some movies do. No company here is willing to sponsor a project that'll go for more than 2 months (they want plumber work; do am make he work today if e f-up tomorrow we go write am again). Any 'fool' can create a windows form project that queries a DB even a non-techie manager . After them go one make indians 'gree say we reach them, who sai! My brother learn cause u loving creating tech not for the pea they pay. |
@kobojunkie. Glad someone in here agrees with me. That's wat i've been trying to tell the poster 4 the past week or 2 even though i've been trying not to make it obvious i'm pushing it in his face. Keep with C++ since u r not hating it.once ur done or while u've covered around 35% of the language moving to any related language will b a work n d park believe me. It worked 4 me and i'm not regreting making that choice a long time back when every obi was jumping to java. Look beyond the trend. Right nw i've got c++/c,java,c#,python,lua,javascript,and i'm getting Ada 2005 under my belt. Plus i'm a game programmer. I remember one article on what Stroustrup(the c++ creator) thinks about java programmers,in he's word 'they act like plumbers, blind to the basics for efficiency'. Do i have to plead that we stop running towards the 'moon' when the 'sun' is d other way. |
@henry.exe.really glad u r getting enthusiastic about programming. Stroustrup's interviews are always hilarious but he's not the first to admit the facts about C++ not being the cleanest language ever created. If u've started rethinking learning some other language like java U can google what he thinks about java. Welcome to a programmers life. Every language was created with a philosophy of what the designer think a programming language should be and since we are only human there's always a diversity of thought. If u want my recommendation start by learning HTML-JAVASCRIPT-VB-C++-JAVA-C#-C-ADA-COMMON-LISP.u should be through b4 u grad God willing. Also research Design Patterns, Agile and Extreme programming, and UML(unified modelling language). I'm always moved to help a newbie anytime. |
@everyone.if Stroustrup said all of that then i'm not surprised (cleaver f**k)lol! There's no perfection in generality of any sort cause perfection comes with specialization. According to the interview,stroustrup is against using the OOP style for very large systems, that's a real minus for languages that are fully OOP supportive like Java ,C#. It all boils down to what engineering of whatever form is(i.e Cutting Corners). Like i said in an earlier post learn one language,then another and another(don't b Biased). And put some thought before creating a system with whatever language. |
Hello everyone. Onto the meal. One might ask 'how do i create a video game?'. Firstly, u most learn to talk to a computer by learning a programming language preferably C++ which supports an object-oriented style of programming. Did i here u say what's that!? Well OOP(Object-Oriented programming) is a programming style very suitable for building complex systems by letting the programmer express the systems functionality as the interaction btw objects/concepts. Hope i didn't get anyone lost there,but if i did i'll elaborate. Consider for a second expressing the idea of a car. U'll find out b4 long that the idea of a tire,an engine,doors,brake pads,and even a driver e.t.c will come to mind. Now, in an OOP language u can express(put) that car idea directly in ur program. Secondly, u need to learn ur maths, u just can't keep running away from it. U will have to learn about Vectors,Trigonometry,Matrix,Newton dynamics, and Calculus. Which really aren't difficult if u want to get into game programming. Thirdly, u'll need to learn about diffrent game libraries like OpenGL & DirectX for 3d graphics and the lot. And finally start by creating a small game(2d preferably). Did i hear someone shout? Didn't mean to get u all sweaty(lol). The truth is u must learn a programming language and start from creating a small game. A lot of game libraries exist to help u with the math stuff but it pays if u knw the math. Now for a real enlightenment. Video games while being monstrous systems that can take from 6months to 9 years to create starting from concept to system design to lunch of the complete game all have the same mode of operation i.e they start, process, and stop. The start/initialization phase is where all needed resources like texture data,sound system,input hardware,video hardware,character model are loaded into memory and initialized. The process phase which is simply one way or another a continuous loop to update every thing that defines the scenario of the game for every other frame and 'painting' the video memory(screen) with it. To make that point clearer,look through ur window what do u see? Yes, what ever u see with ur eye is inprint/'painted' in ur memory/brain at every point in time. Take another analogy, if there was a painter with a canvas and he could paint what he sees in 1/60th of a second or less of people walking about and interacting with one another and shows u that painting every 1/60th of a second u'll perceive motion on the canvas. That's what game programmers do by using the computer as a very fast painter. The final step of a game is when it stops(destruction phase) which just does the opposite of the initialization phase. Walla! In preparation for next weeks exposure get to the net and download SDL from www.libsdl.org. See u soon. |
A marvelous idea! |
@henry.exe. C# isn't a superset of C++ or C. It's not code compatible with either because it has a different philosophy on how a program should run on the system(though i'll say the syntax is about 75% similar to C++). But if u use .NET technology u can have quite similar feel because in .NET programs written in any of the .NET supported languages(VC++,VC#,VJ#,VB) can communicate with each other and share resources. If u need a gui library try wxWidgets. I knw it seems u write more code just to get even a blank window on screen but u'll be a better CS by it in d long-run. |
@poster. It's really nice to hear u were introduced to the C++ language. From wat u posted it sounds like u r only intrested in programming just for finding a job as a programmer as soon as u leave school. That's really short-sighted if i might add. Well, to give an unbiased answer it's true that at one time in nigeria java was the in-thing to get a job, now C# is gain grounds, far back Fortran was, then Pascal and on. The truth is in this country software development companys follow the most advertised language without really considering deeply if it's appropriate 4 the job. You might switch to learn java and by the time u r through learning its ever changing in's and out's C# will b the most demanded or even Ruby. My advice is start with wat ever language u r confortable with then after learning that one learn another then another and another. Don't be in a hurry just because u need a job. If ur onions are good when the opportunity comes u'll be the on calling the shots. If u need my recomendation on a language to start with i'll advice u stick to C++ since u don't show any sign that u hate it.it's the most used language for commercial software development overseas, it has the most available libraries, and the efficiency of a system level language. Believe me,learn C++ then learning any other language after it will be a breeze. If u need a good beginners tutorial on C++ go to www.softlookup.com. Good luck! |
@poster. Is a c++ programmer with knowledge of ASP, MS SQL server dbms, and java scripting needed? |
@pc guru. Ogre3d is an open-source graphics rendering engine written in C++ with an object-oriented design. It supports both direct3d and opengl graphics API's. If any one needs a question answered u can send it to my mail. That's: dueal21@yahoo.co.uk. I'll respond asap. |
Hi everyone,sorry for the delay in posting again. So since i'm assuming a large percentage of us have played a computer game whether on a PC or dedicated console i'm not going to define wat a video game is. Instead i'll state wat every video game must have. 1. A graphical representation. 2. A means of interaction with the player. And 3. The game logic. The other aspects that games have which i call "peripherals" but can really transcend the game to a new level of excitement if done properly are; sound,physics, enemy AI,and networking. I think i forgot to mention that i'll be including game networking in my discussion. So back to what i was trying to say 4 the week. A question that beginners punder on is 'how is it that this lil man on my tv screen runs,flys,jumps,fights,and even sings?'. The truth is he doesn't do all those things and there is no lil man there. The developers of that game which has u up all night glued to the screen are simply using the computer to play tricks on ur senses. One trick which some of u may not know about is PERSISTANCE OF VISION. Which is the phenomenon of the brain to interpret a series of similar advancing images played-back one-by-one in quick succesion as one continious motion. This 'illusion' technic is used whenever the perception of motion is to be replicated on screen. As a lil exercise get a note book (not the one u use for school) open it,pick about 12 sheets and on the longer edge draw stick figures of a man jumping up and down starting from ground then advancing his jump to a height then landing. Note to draw each advancement of the jump one for each sheet and they should be stacked. When ur done flip through the sheets u'll see that ur man/woman jumps. I remember using that trick on a girl back in primary school to show how her nostril grew and shrank at her will. Have fun! See u all soon. |
@flagship. A wise man once said," He who overrates his understanding undercuts his potential to learn new thing". Practice somemore. |
I agree with u my brother, e no easy at all, but that hardened end of it gives us our job security cause not everyone has wat we have to remain in this business (die hard determination and a craftmans sense). |
The measure of the reliability/fail saftyness of a software system is a function of many factors in which even the design of the programming language used is one. |
@Ghenghis. I don't remember saying that software doesn't fail if that's wat ur assumption is. Software is always infested with flaws no matter how much effort u put to testing or how large ur development team might be. The essence of software programming is to deliver a product that satisfys(no mob reaction if something fails) its customer and there is no implied 100% assurance that it will not show its quirks. The developer can only give his/her customer some measure of assurance that the most disastrous things won't occur from their reliance on the product( like the total loss of data). Even the Giants give no 100% assurance but we still use those products they provide (no developer or his kid gets killed). If they did then we won't have the issue of getting new service packs for an already delivered product. I only made my previous post becos i was surprised that we programmers here have to be told of the importance of software testing by the starter of this thread. If that's the case then we all shouldn't be give the title of a programmer (what's a programmer if he doesn't test).i'm certain testing is a node in the software development tree .So what's the use of a topic like 'The importance of software testing and not just software programming'. What do u think? |
@fatezy. Hi, looking at the tech u r versed at ( vb, asp, sql server) i assume u r looking for pro certification of a database app developer. And considering that the tech is all from MS u should just get certification 4rm them. Wat do u think? |
Going through the threads on this forum i ran unto this topic and had a lil laugh. 'The importance of software testing'. Like popular saying , Software that hasn't been tested simply does not work. You must continously with emphasis go through the iterative process of analysis,design,implement ,test.ur work ain't done yet till u r convinced each stage has been considered to a depth. You don't need to be a rocket scientist to decipher that. Ha ha! |
Hello everyone. Today i'm starting a thread on this forum strictly for people who have always wanted to get into creating video games for the PC. I'm a 7yr developing PC game programmer versed in the C++ language, lua scripting and a wide arsenal of game developers libs and tools. So what i aim to do by starting this thread is to give tips from my experience on how to really create games(2d & 3d) that play. I'll be using/exposing these tools in my discussion: OGRE3d for graphics, Cegui for GUI, ODE/TOKAMAK for physics, SDL, OIS for input, OPENAL for 3d sound, LUA for scripting, and also C++ topics. I hope this will be and inspiring exposure into the fun world of game programming. You can normally find me on the Graphics & video forum(2d/3d Art gallery thread) by the name dueal, and if u r observant u'll notice that my 3d art is 'gamey like'. See u soon. |
Since when did this tread become 'forbidden' or is d cold freezing d creative minds we had in here? |
My vote's 4 xothermik. |
Stuck to my machine.
|
!? Tat's all folks.
|
And finally a lil WIP for my manager and friends who wish to see me do more human characters. Till next time folks.
|
process). Later people!
;