Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Game Template (Open Source)

Author
Message
DigitalFury
9
Years of Service
User Offline
Joined: 30th Jul 2010
Location: United States
Posted: 16th Jul 2011 10:20 Edited at: 15th Sep 2012 01:03
@MOD - Can u delete this thread? I already made a new one for DBP thanks



I finally decided to make Game Template open source. I don't have much time to work on development and I would like the community to speed up the development of this great idea.

It is a DBP Project and I posted this in the wrong thread. If a mod could delete this thread I would appreciate it.

DigitalFury
9
Years of Service
User Offline
Joined: 30th Jul 2010
Location: United States
Posted: 17th Jul 2011 08:04 Edited at: 18th Jul 2011 08:16
Documentation

Click Download at bottom of post to download the documentation!


Question: Should I keep documentation posted here or just the downloads and links to google docs? I need your opinion. Does it affect the load time to much? Thanks














Donate to the Game Template!

Attachments

Login to view attachments
DigitalFury
9
Years of Service
User Offline
Joined: 30th Jul 2010
Location: United States
Posted: 18th Jul 2011 05:54 Edited at: 22nd Jul 2011 08:49
Introduction

Tutorials + Examples


Here are some tutorials and examples showing a few features of the Game Template. I will post new examples here whenever I finish them.

Tutorial List:
- Dynamically Loaded Resources: Part 1
- Dynamically Loaded Resources: Part 2
- Dynamically Loaded Resources: Part 3
- Naming Resources: Part 1
- Dynamically Loaded Resources: Part 3
- Naming Resources: Part 2
- Coroutines
- Multi-Threading
- Performance: Loops Per Second
- Performance: Running the Main Loop at the Same Rate
- Performance: Part 2
- Timers
- Timers: Part 2
- Timers: Part 3
- Shoot Object Tutorial
- Mini Tutorial: Eyes Follow Cursor
- Pulse Gun: Part 1

Donate to the Game Template!
DigitalFury
9
Years of Service
User Offline
Joined: 30th Jul 2010
Location: United States
Posted: 18th Jul 2011 06:04 Edited at: 22nd Jul 2011 08:44
Classes:

- Dynamic Resources: (Updated)
- Load Resource

Indexes are hard to keep track of and you sometimes end up with a lot of empty indexes that you could recycle. The template assigns indexes, recycles indexes, and searches for indexes by name with ease. When the template starts a File Database is created for looking up resources and where they are located. You can load a resource just with a name and the index is returned. You can also lookup loaded resources to find that index.

Donate to the Game Template!

Attachments

Login to view attachments
DigitalFury
9
Years of Service
User Offline
Joined: 30th Jul 2010
Location: United States
Posted: 18th Jul 2011 07:02 Edited at: 22nd Jul 2011 08:47
Classes:
- Load Lua
- Name Item
- File

The ScanFolder function will scan all the folders and sub folders and add all the files/folders to the array. The array can be saved via Dark Data database or .dat File.

- Timers

You have two different types of timers: Normal game timers and event timers. Game timers just keep the games time. You can reset the timer at any time using ResetTimer(). An event timer is a countdown timer that calls a function when it reaches 0. It can run once or reset when it reaches 0.

- Performance

Performance is also another major feature of the Game Template. The Performance code will run the loops at a constant rate of Loops Per Second. Threads are also run just like loops. You can set the rate of any performance loop or thread giving you control of how fast or slow you want everything to update. Whenever a loop isn't running it will use "Nice Wait" to return the unused time back to the processor. This means the CPU usage will be very small. As you use more CPU power the CPU usage will go up. This technique insures that the CPU usage will be minimal.

Donate to the Game Template!
DigitalFury
9
Years of Service
User Offline
Joined: 30th Jul 2010
Location: United States
Posted: 18th Jul 2011 09:14 Edited at: 22nd Jul 2011 08:44
Classes:

- Animation

I cataloged all the animation for: Character Shop, The Apocalyptic Pack, and Model Pack 10. It will automatically extract and write an animation list for every animation. You can also load an animation using the LoadAnimation() function. Any animations you load can be looked up the index using GetAnimation() function. You can provide the Objects Name and the Animations name to get the index. I formatted the File Name of the .anim file to be easy to parse. This makes searching and loading easier.

- Multi-Threading

I finally figured out how to get multi-threading to work! You need Matrix1Utils for this to work.

Important Notice: Multi-Threading is not Thread safe! You must protect EACH and EVERY variable you access. If you access a variable from the main thread and the new thread u get a collision (read/write at the same time) and the application crashes. You can't have to threads accessing the same variable! Just wait for my new multi-threading lib with mutexes to be released!

Donate to the Game Template!
Dar13
11
Years of Service
User Offline
Joined: 12th May 2008
Location: Microsoft VisualStudio 2010 Professional
Posted: 19th Jul 2011 06:03
Since this uses DarkBasic Professional, why is this in the DarkBasic Classic board?

Perhaps you could ask a mod to move to the DBPro board?


DigitalFury
9
Years of Service
User Offline
Joined: 30th Jul 2010
Location: United States
Posted: 19th Jul 2011 07:11 Edited at: 22nd Jul 2011 08:45
Oooops. lol

@Mod - Can u delete this thread? I created another thread. Thanks

Posted in wrong thread Sorry. lol

Donate to the Game Template!

Login to post a reply

Server time is: 2019-08-25 16:20:19
Your offset time is: 2019-08-25 16:20:19