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 Professional Discussion / Asynchronous thread

Author
Message
eayonov
10
Years of Service
User Offline
Joined: 7th Jul 2014
Location: Russia, Perm
Posted: 10th Jul 2014 16:58
Hi,
I need to make an asynchronous thread to control time, weather, day\night, mouse, quests, NPC and other process into the core of my game.
Can I make it in DBPro?

Thanks

sig
SamKM
15
Years of Service
User Offline
Joined: 25th May 2009
Location:
Posted: 11th Jul 2014 01:38 Edited at: 11th Jul 2014 01:40
This is actually possible, although it can be pretty annoying to set up and maintain. You need to create a separate program to handle game data, and then have it send data back to your main program. The best way to do that is to use DBPro's Filemap commands, which are read filemap string/write filemap string and read filemap value/write filemap value
I'm not sure what you're making, so obviously you know much more than me, but to me most of the things you've listed look as though they could maybe be built into your main program. If you don't think it'll cause problems having it all in one program, I'd definitely recommend that - having to send data between two programs is much more irritating than having it all in one place
Good luck

The code never bothered me anyway...
MrValentine
AGK Backer
14
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 11th Jul 2014 03:02
Look st STYX's Intervals and Callbacks and references functionality, I practically use STYX is every project I start... You can perform Synced and Un-Synced intervals

You can look for Matrix1Utils if it also has the interval usability... [26 looks to have it """26 - Syncs and callbacks"""]

Hope this helps...

eayonov
10
Years of Service
User Offline
Joined: 7th Jul 2014
Location: Russia, Perm
Posted: 11th Jul 2014 08:14
Thanks SamKM. What is Filemap?

MrValentine, thanks. But Programming is a process of self-improvement. I want to make it myself.

sig
MrValentine
AGK Backer
14
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 11th Jul 2014 17:34
No worries, File mapping is the process of shared files between apps, if you made two apps which accessed the same file, one or both of them would fail, file mapping is for this purpose, allowing access of the same file and data between two applications...

eayonov
10
Years of Service
User Offline
Joined: 7th Jul 2014
Location: Russia, Perm
Posted: 16th Jul 2014 13:37
Ok, thanks MrValentine.
How can I use it? Any small example please.

sig
MrValentine
AGK Backer
14
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 16th Jul 2014 15:18
Of the file mapping or the async?

Chris Tate
DBPro Master
16
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 16th Jul 2014 16:45 Edited at: 16th Jul 2014 16:47
Filemapping input resides in RAM before automated mapping to file and enables multiple I/O operations on a file and is often used with databases; somewhat like Mr.V stateds providing access for different applications. It is better to use file-mapping to share data between applications; not for any intense processing.

Good luck; you will hopefully find working multi-threaded functions in existing plugins; otherwise you may have to wait for my plugin to be completed.

MrValentine
AGK Backer
14
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 16th Jul 2014 20:16 Edited at: 16th Jul 2014 20:17
Quote: "
File Mapping
Sharing data between multiple programs running on the same computer can often be difficult. The File Map commands provided in the expansion pack makes this process much simpler. When creating a file map a global, shared amount of memory will be set up in the Operating System. This can then be read and written to by a Dark Basic Professional application. Then either other Dark Basic Professional applications or applications written in other programming languages that natively support file mapping can access the shared memory.
"


Enhancements Expansion Pack

EDIT

I can show the example projects in a video if that helps...

eayonov
10
Years of Service
User Offline
Joined: 7th Jul 2014
Location: Russia, Perm
Posted: 17th Jul 2014 08:48
Ok, thanks to all.

sig

Login to post a reply

Server time is: 2025-05-13 11:11:14
Your offset time is: 2025-05-13 11:11:14