Programming questions

(Skanime) #1
  1. Can you program a game for Blender in other languages (C++, Java, etc…) If so, where can I find out about this? If not, where can I find python tutorials?

  2. How hard would it be to make a multiplayer client/server thing for a game?

(saluk) #2

I’m not sure about using other languages; lots of info about python at (if you know those other languages you mentioned, it should be a snap to learn).

I’m having some difficulty setting up a client server thing, but that’s mostly due to my inexperience. It doesn’t really seem to be that complicated, I just have some problems with my in-game message system and code that REALLY messes up when provided with unreliable internet packets.

(Skanime) #3

I only know VB. Anyways, me and some others are thinking about making a game. I’ll actually end mostly doing graphics, but there are some others who will do programming. BTW, my current idea for our game is an oriental Samurai/ninja type game starting out as a basic deathmatch game that we can just play across the network (we all go to the same vocational school and when we play network games our teacher gets mad, even if our work is done so, if we make a game, we figure we can pull a “we need to test the game”, long parenthesis). Eventually, we’ll add a character custimization and turn it into a MMORPG.

(saluk) #4

Sounds like a great project. I’m currently working on a flexible level editor/game engine in blender with networking support in it that would perfectly fit a massivly multiplayer game, and it sounds like it would fit your project. I’m still a ways away from finishing it, but you probably should do everything yourself due to it being for school anyway.

Still, when I finish it’ll be posted up in the realtime forum for you to steal if you like:)

I’m looking at hopefully having it mostly done in about 2 months.

(Skanime) #5

It’s not for class really. The class is and IT class with people taking programming (many different languages), cisco (me), computer repair, and web design. All by one teacher, which makes him pretty busy. This allows for an open, work at your own pace atmosphere. The VB class was easy, not I actually have to work so I can get my CCNA.
Anyways, we want to make this as a side project for something to play and maybe eventually market. And we are actually now leaning towards a cyberpunk game, looking at using a city gen program we found on that lingk page that one guy put up, if we can covert it into Blender, though I’m willing to take a look at your program, if it can be used to make city enviroments.

BTW, my current dream for the cp mmorpg (I have lots of time to think on the bus ride to and from my vocational school). Like Atriarch with a fully round world. Near future, world is composed of several (15-20) warring countries with cities dotting the earth, but a lot of wilderness. Also multinat. corps fighting for control of the market. All kinds of tracks besides fighting. Cybernetics, robotics, genetic engineering (allowing for cool monstrousities, imagine fighting a dragonish beast with your cyborg character and his/her little robotic sidekick. Fun? You bet!) We are still in concept stage so not to fleshed out.

(Skanime) #6

Concerning the round world thing. I’ve seen stuff out there about Fractal mapping, that you could take a cloud image generated in say, Photoshop, and use the different shades to represent different heights. what I would like to do, is figure out how to apply this map to a sphere (either one, I forget which is which). Perhaps an algorithim (sp?) that moves each points to a specifice distants from a center point while maintain the same measure on two angles compared to the center point (this is to keep it on the same “line” coming out of the center point, so you don’t get a point on the opposite side of the world as the other points in connects to. This would allows for the creation of a millions (billions) of polygon round world with (relitivaly) little effort. It would be a lot easier than going through and messing with each point individually.

Also, anyone want to help with this game, we need all kinds of talent: Idea people to help flesh out concepts and develop the stat/skill system, modelers and animators, as we want to have tons of player models (even nonhumanoid ones) and items and stuff, and last but not least, programers, to implement the stat/skill system and do AI stuff and such. Sorry, but at this point, there is no chance of getting paid, though if we ever market the game, everyone who help will get a check (based upon contributions, which will be kept track of for each person). Plus, you get your name in the credits, complete with a list of all your contributions, which can look pretty good on a resume when applying to an actual game company.

Damn, someone shut me up. Ok, I’m done now.
PS. I’ll put up a website some time.

(RipSting) #7

Search for some TCP/IP routines that are compatible with Python for some net code. Basically you can do anything you want in python (including messing around in the Windows API for example), you just have to find the right modules.

I’d be happy to do some modeling and texturing for you. I’d rather not do much programming because I’m getting warn out in that area. Now I’m learning (Which is hella different from VB6) for integration with

I took two years of a cisco networking class. It was boring as hell because all we did were the crappy online lessons! If you’re going to try for the CCNA, take it right after the last class! I think I’ve forgotten too much of it to take the test. It would just be a waste of $80.

(saluk) #8

Yikes sounds like a really big project. Probably too big for blender at this stage in time, but a future blender might be able to handle it:) But python can handle networking really well, if you can program good networking classes in it. Your free to use my code when (if) I finish, other than that I’m a little to busy to actually be in on the project.

But a cyberpunk mmorpg sounds cool! Reminds me of my Shadowrun days back in 9th grade.

(Skanime) #9

Yes, online lessons. Much fun. I’ll definetly take it as soon as possible, although its $100 now.

As for the game, not sure if it’ll be the huongous world thing to start. We’ll do itin stages starting with one city and working our way up. It could be year before we are ready to do the round world thing anyways.

Also, I came up with a tile type system for make buildings where you take wall tiles and floor tiles and mix them together to make a groung floor. Then, you make a seperate “module” for all floors above that which is like the first only not door (unless you want a deck) and has “holes-in-the-floor” for elevators and stairwells. Maybe you can put them into your tool thing.

As for modeling help, we need to get organized before we can tell you what we need. I guess for now you can make different head models, both make and female. The scale for the game will be 1 square = 1 foot (30 cm).


(TankCoder) #10

well, The idea for your game is nice but I wouldnt reccomend blender or VB for the job.(You must use python to script for blender unless you write some modules in which you can use C/++) Blender because its game engine has some drawbacks. First of all because even though python has good socket support, Blender handles python scripts a little funny so it will freeze until the python script is completed and the socket module waits for a message untill it loops again. this causes blender to freeze while waiting for a message. I think there may be a way around this but that is the story put simple. Second of all because the BGE is a little slow. Good enough for some types of games but a MMORPG is really intensive and takes a lot of resources to power. I wouldnt reccomend VB for 3 reasons: Its slow, its not cross-platform, and its really a horrible language :stuck_out_tongue: . I would reccomend using Crystal Space or some other free game engine thats both portable and powerful.

(saluk) #11

You can get by the freezing blender problem with threading, but threads can be somewhat of a resource hog. No worries though, still, if you have good coders, I would go with crystal space or another engine like tankcoder said. Right now, there’s just no telling if blender’s game engine will be improved enough to handle the game. I think it will, but I’m usually a bit overpositive.

Do whatever you want, the good thing about blender is how quickly you get to see your results. No compiling, no waiting, you just click go and it’s there. The downsides of course, are speed and flexibility. Hopefully it gets better, but it probably wont ever compete with a real hardcore graphics engine.

(Skanime) #12

So will Crystal Space be able to handle this game project? Are there any other free 3d programs I can check out cause CS is big.

(Skanime) #13

Ripstring, go to and fill out the form there so I can send you the password for the members area, where you can find a list of stuff that currently needs to be worked on.

saluk, how does you client/server model work exactly, I’m just wondering? Also, how will the level editor/engine work and what will it do?

(saluk) #14

Ok, here’s how it works right now:
I have a python class called obdata, this is how objects are stored. It contains information such as position, orientation, plus a list of properties. It also has functions to allow you to change these properties, save/load the data, etc. It also has an id.

When you create a new object, it creates it’s own new, original id. The id will NEVER be the same twice. When you LOAD an object, it uses the id from the obdata. So the id will remain the same for a particular object throughout it’s life. This is important for later functions I will write to sort the objects based on where it is in the world - when the object isn’t in memory, we need to make sure we load the right object again if we go back to its location.

In the blender, it keeps all the obdatas in a dictionary. If the obdata does NOT have an actual game object linked to it yet, it sends a message to the adder to add an object and links it to the obdata. I could also do things like having the obdata in memory, but the game object NOT in memory slowing things down. For a line of site function. There is a message system that can take a message in a list or a string, and has different object commands that are used in the system. The main reason for having my own message system, is I can easily convert in-game messages into network messages.

The level editor is necesary, because hand editing the values for all the objects in a large world would be insane. My old one worked fairly well, it has a cursor you move around with the mouse, letting you rotate it etc. You can also choose which object you will place. I had it so that you could “drop” the objects down to the floor, so you don’t have to worry about the ground height when placing a lot of objects such as trees on the mountainside. No worries about floating trees.
Eventually, I will have more of a GUI as well, allowing you more control over the objects, changing their properties etc. You can have the game RUNNING and still change things around. This is necesary for a massively multiplayer game.

The client server:
Basically, I have a pure python server that recieves connections from clients. It responds to tell the client that it is connected, as well as sending the current state of the world, and the server keeps that clients connection open in a list. Clients can send messages to the server, and the server can send messages to it’s clients. When the server recieves a message, it rebroadcasts that message to all clients except for the one that sent the message. Hopefully this isn’t too laggy and won’t get out of sync too much. If necesary, I can have the server rebroadcast the world every little while to keep the clients syncronized.

Eventually, I will store the clients cell position on the server as well, and messages are only rebroadcasted to other clients in his same cell.

I haven’t added cells yet, but each object’s position will be reduced to determine it’s cell. The engine will only load 9 cells at a time, the cell the player is currently on, and the 8 cells surrounding him. When an object is saved, not only does it save itself, it also makes sure its id is located in the cell. So we don’t have to constantly search ALL BILLIONS of objects to figure out which ones to load, we only have to look up a short list of objects that correspond to the cell.

If the world is really big, it will probably need many servers to actually handle all the cells. Preferably one server per cell, but perhaps each server could run several. I’m not talking about my game, just what would happen if you tried to host a REALLY BIG world on the engine.

Now I’m going to put all this in my readme for when I release it:)

(Skanime) #15

Nice, how hard would it be to convert that over to work for our game. We’d have to have more than one cell on a single server because 1. We may not be able to have more than one server at once, if at all, in the near future, and 2. the main city itself will be 9 cells, down town and then the surronding areas, all still very urbanized, but less huge skyscrapers. Then, each floor on a building will be its on cell because there will be be more objects in an interior (furniture, “faction” gatherings). Can the level editor make the insides of buildings such as labs, or apartments or offices? Also, what scale are you using for your level editor, so we can make our game compatable?

(saluk) #16

I don’t know the answers to most of your questions as I’m not finished yet. It’s very much a skeleton right now, if it gets to a point where I can answer all of your questions, I’m probably done enough to release it:)

As far as scaling, I want to make it able to scale to anything you want basically. I’ll have an options text file that you can edit to change different values it uses, like how fast the cursor scrolls, and how big cells are. When I develop the cells engine, it’s going to be set up so that you have to TELL it when to load a new cell or remove an old one. This way I’m not limited in what the cell shape or size. After this, I’m going to have an addon that automatically loads cells 9 at a time on a grid as I mentioned before. For a complex city, just explicitly telling it when to load the cells probably makes more sense than the grid, which is better used in big terrain games. You can have it load the next floor for example when you go in the elevator.

The problem of running multiple cells as far as I can see right now, is that BLENDER is really slow. Running multiple cells on a machine might mean running several instances of blender at once. It might work just having ONE blender running all the cells, but we’ll see. I’ve got a long ways to go for that.

I’ve also got a completely different system floating in my mind that has to do with object scopes, but it will have to come in version 2 or 3:)

As for using it for your game, what is your timeframe for the project? I’m not sure when this will be ready, but I’m looking at at least 2 more months of development before the system is more or less complete. And knowing how much release dates tend to be pushed back, it could even be longer than that. So I don’t want to get your hopes up, especially if you need to be finished in 2 months. What will your programmers do for 2 or more months, while waiting for this toolkit to be finished?

(Skanime) #17

Ok, if you know the city gen program, you knowq that it creates cities that are 64x64 grids with a single grid unit being the size of one building, filled with either a building or street. Will I be able to load it into the toolkit? If I can, I could divided it into 8x8 cells or even just 4x4.

As for what we’ll do in the next 2-3 months.

  1. Increase our skill with Blender and Python, since many of us still need much practice.
  2. Work on game concepts, rules systems, world design (so we know what we need to create when the tool kit is done), and story line.
  3. Work on models and animations.
  4. Start programing the skill system.

As you can see there is plenty of things we can do while waiting for the toolkit.

The time frame I’m hoping for is a good, solid, playable game by March. We done even have to have the skill system ready by then. I’m aming for atleast getting it to fps like to be played as a psuedorpg, where all roleplaying is faked and if the players want they can just start shooting each other. The server won’t have to handle that many people, maybe 10 from the school and anyone from the blender community who wants to play. We’ll probably schedule play sessions (hey, everyone woh want to play the server will be up on Tuesday from 8:00 - 9:30 AM, btw anytime I give is Central time, cause we’re in Illinois). If we could get the skill system ready, or at least part of it, that would be cool, but it’s not priority.

I would like to have a basic job system ready (jobs are like quest in this game). Go to certain employers (corps, mafia, rebel groups, etc…) and choose from some jobs. We also won’t be using seperate quest areas. Every job you get was already in the world before you took it. You could take a job from a mafia family to kill the head of a rival family, or you could just stumble upon the the rival families HQ and kill him/her anyways. Once the skill system and different career paths are ready, you can get non combat jobs. Hack a corporate mainframe (kind of combat), make a new weapon for the government, make a vehicle to catch participants in Urban Bloodball.

Urban Bloodball? What’s that? Glad you asked. UBB is pure, hardcore cyberpunk sport. Team of 8 race around city streets (where there are people and cars) at high speeds (150 mph) and try to get a ball into a hoop flying around town. Highly illegal but the only way the cops can ever catch anyone is if they take a spill, which ussualy kills them anyways. And once your dead you just get cloned, if you tought to go to clonig agency ahead of time so they can get a dna sample and mind print. Okay, I’m done now.

(saluk) #18

Heh, this sounds totally cool. I haven’t seen the citygen program, but I don’t see how it wouldn’t work with the toolkit. The toolkit isn’t built around the tiles, it doesn’t know the sizes of anything, so anything should fit. The only thing that would need to be modified are cell distances for the tiling code, and the cursor speed to allow you to scroll larger maps with ease. I can easily put this in a configuration file, or, if necesary, I might add project files that save all the configuration type things along with the world etc.

Hopefully the toolkit turns out as good as I want it to be!

(Skanime) #19

How many vertecies/polygons should I limit objects to in a game like this?

(saluk) #20

Characters etc, Id say about 300; all the objects on screen at once shouldn’t exceed the maximum amount of polygons your target card can render under a proper framerate: probably roughly 4000 polygons max for all objects in a scene at once.