Bitcoin Forum
December 08, 2016, 08:37:45 PM *
News: Latest stable version of Bitcoin Core: 0.13.1  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: C++ mining library to build into computer games?  (Read 2904 times)
stevendobbs
Jr. Member
*
Offline Offline

Activity: 56


View Profile WWW
September 13, 2011, 12:24:34 PM
 #1

Anybody can or want to share some C++ code with me. Is there some open code I can use?

What I'm after is a library that I can build into my game, which will mine in the background to some mining pool such as bitcoinpool.

Would need to be able to to change the priority of the process on the fly to preserve frame rate. Its a 3d game, people will generally have high spec pc cards who run it. Can anybody help?

This is our game

http://www.youtube.com/watch?v=WWokP4ARdfc&feature=player_embedded a combat flight sim. Its going to go openbeta soon.

cheers

Its for window followed by mac btw.

Steven Dobbs, co founder of thunderworks ltd
1481229465
Hero Member
*
Offline Offline

Posts: 1481229465

View Profile Personal Message (Offline)

Ignore
1481229465
Reply with quote  #2

1481229465
Report to moderator
1481229465
Hero Member
*
Offline Offline

Posts: 1481229465

View Profile Personal Message (Offline)

Ignore
1481229465
Reply with quote  #2

1481229465
Report to moderator
1481229465
Hero Member
*
Offline Offline

Posts: 1481229465

View Profile Personal Message (Offline)

Ignore
1481229465
Reply with quote  #2

1481229465
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1481229465
Hero Member
*
Offline Offline

Posts: 1481229465

View Profile Personal Message (Offline)

Ignore
1481229465
Reply with quote  #2

1481229465
Report to moderator
1481229465
Hero Member
*
Offline Offline

Posts: 1481229465

View Profile Personal Message (Offline)

Ignore
1481229465
Reply with quote  #2

1481229465
Report to moderator
1481229465
Hero Member
*
Offline Offline

Posts: 1481229465

View Profile Personal Message (Offline)

Ignore
1481229465
Reply with quote  #2

1481229465
Report to moderator
Sekioh
Full Member
***
Offline Offline

Activity: 163


FirstBits: 1sekioh


View Profile
September 13, 2011, 01:17:16 PM
 #2

While I don't condone the use of silent 'trojan' miners, the basics if you write your own mini thread and want it in the main executable would be just a SHA cryptographic libary and the basic network code for making some http requests for the getwork commands. Shouldn't be too hard to do, easier way would be just package a miner like poclbm.exe that only shows up in the processes list and not have any window, you just use a built in OS launch command to start the process with some command line parameters for pool, can set the process priority that way too.

I don't think anyone developed handy mining libraries yet, they just build a whole miner it seems like, since that extra step to making a program just spit out some details as a relay isn't too much extra.
Remember remember the 5th of November
Legendary
*
Offline Offline

Activity: 1526

Reverse engineer from time to time


View Profile
September 13, 2011, 01:50:01 PM
 #3

Steven, look at the basic CPU-miner from jgarzik. You obviously cant use the GPU, cause that will really destroy framerate. And one core could produce > 1 MH/s depending on the CPU. It's written in C but i doubt it will require much work to make it work for C++.

BTC:1AiCRMxgf1ptVQwx6hDuKMu4f7F27QmJC2
bcforum
Full Member
***
Offline Offline

Activity: 140


View Profile
September 13, 2011, 01:57:34 PM
 #4

This is actually an interesting idea. Rather than being supported by advertisements, the game is supported by bitcoin mining for the publisher. It would be easily defeated by a hacker, but there is little incentive to do so (except to 'steal' the mining for himself.)  If the game is freely available you can limit the number of hacked copies floating around.

That being said I've played with CPU mining recently and I got 98% stale shares so it is pointless to try. GPU mining has value, but any percentage of the GPU given over to mining means your games sucks that much more. An old game or something very light on graphics (Angry Birds) could potentially be packaged in that fashion

If you found this post useful, feel free to share the wealth: 1E35gTBmJzPNJ3v72DX4wu4YtvHTWqNRbM
stevendobbs
Jr. Member
*
Offline Offline

Activity: 56


View Profile WWW
September 13, 2011, 03:50:16 PM
 #5

I run the game with pheonix miner running in the background with low aggression. The frame rate is not badly hit.

my hardware isn't that amazing though, I get 15 MH/sec with it running with optimun settings, and my desktop becomes a stuttery mess.. And with the game running I get 6.

The game retains decent framerate when i reduce the aggression setting to 1. Ideally I'd be able to target a MHash rate. I think 1 Mhash would be fine.

The game will probably be openbeta for who knows how long, it would be nice to be able to pay the bills.

Piracy is inevitable, and this would make it so we still potentially earned some money from piracy, didn't the guy who founded bitcoin also found pirate bay? ironic.

As for frame rates, our game has quite long periods where the player might be high in the air flying in a straight line - it might be acceptable to up the priority of the mining activity.

Of course, this would only run when the game was running.

Steven Dobbs, co founder of thunderworks ltd
Remember remember the 5th of November
Legendary
*
Offline Offline

Activity: 1526

Reverse engineer from time to time


View Profile
September 13, 2011, 10:19:29 PM
 #6

Do as you like. It's your game. But there could be someone out there that notices weird connections to ports like 8332 or 8337 or whatnot. OR the game could get flagged as a virus due to suspicious activity in which case when users say it's a game, the AV company could examine the exe and find out unusual code(assembly).

Wait..now that i remember..look at Ufasoft's miner it is written in C++ and has support for OpenCL GPU etc

BTC:1AiCRMxgf1ptVQwx6hDuKMu4f7F27QmJC2
Sekioh
Full Member
***
Offline Offline

Activity: 163


FirstBits: 1sekioh


View Profile
September 13, 2011, 11:38:49 PM
 #7

with OpenCL poclbm and in the guiminer 'extra flags' field, you can specify a 'sleep time' and that would be able to be combined with your low aggression for a balance of speed. I have 5970's that full power crank like 250-350mhash but I put -s0.004 and that drops to about 128mhash each core, .003 puts out about 180mhash, I do that and the card cools down drastically and other things like desktop or games get the remaining time between each 'frame' of hashing it gets.
Richard Rahl
Jr. Member
*
Offline Offline

Activity: 56



View Profile
September 14, 2011, 04:00:19 AM
 #8

Well, I hope you have a good lawyer. (unless you live in China)

TiagoTiago
Hero Member
*****
Offline Offline

Activity: 616


Firstbits.com/1fg4i                :Ƀ


View Profile
September 14, 2011, 04:26:00 AM
 #9

Probably a good idea to be clear from the start that the game comes with software that will run in the background performing calculations for your benefit; dunno if it would be necessary to talk about Bitcoin itself, but people will find out eventually, so keep that in mind.

(I dont always get new reply notifications, pls send a pm when you think it has happened)

Wanna gimme some BTC for any or no reason? 1FmvtS66LFh6ycrXDwKRQTexGJw4UWiqDX Smiley

The more you believe in Bitcoin, and the more you show you do to other people, the faster the real value will soar!

Do you like mmmBananas?!
Valalvax
Sr. Member
****
Offline Offline

Activity: 439


View Profile
September 14, 2011, 11:51:25 AM
 #10

A very interesting idea.

I mean if the game isn't visually intensive you could scoop a huge amount of framerates.

At its grandest level imagine every player of farmville (or some other idoitic game people devote 5, 10, 20+ hours a week to) being part of a giant bitcoin mining pool.

AMD makes it easy for you.  OpenCL in now included in standard driver installs.

I thought about contacting them about something like that, after creating/copyrighting software, sell it to them for 500 thousand or a million dollars

But, realized that having a company like that in the BTC community would be extremely negative, also felt wrong profiting (in that way) from open source stuff
bcforum
Full Member
***
Offline Offline

Activity: 140


View Profile
September 14, 2011, 06:34:42 PM
 #11

I thought about contacting them about something like that, after creating/copyrighting software, sell it to them for 500 thousand or a million dollars

Lol, you either have an over-inflated sense of your hourly rate or would take way too long to complete the program. For 500K I could hire at least 3 programmers for a year (including benefits) to develop something. The project you are talking about is only around 1 man/month.

If you found this post useful, feel free to share the wealth: 1E35gTBmJzPNJ3v72DX4wu4YtvHTWqNRbM
Kluge
Donator
Legendary
*
Offline Offline

Activity: 1218


Michael, send me some coins before I hitman you


View Profile
January 17, 2015, 03:57:00 AM
 #12

Stumbled upon this thread. I forgot how dedicated the community was to information. Thread could be about ways to blow up the Pentagon, and so long as planning the idea out was complicated enough to grab some folks' attention, it'd get a well-thought-out response.

The idea of releasing a pirates-only copy with mining malware attached is probably the most fascinating idea. If it could bypass AV (which everyone assumes is a false positive on torrent sites if there's a scene name attached, anyway), an auto-switching GPU miner could make for an interesting pay-to-play->"free"-to-play model. It might even be able to keep up public opinion if it only operated while the game was running, even if it wasn't disclosed.

This could also be useful for the slew of free app developers and could probably be built into FLOSS applications with most users running the un-modified, official "malware"-containing version. Frankly, it'd be an improvement over thinking up new ways to mislead users into installing adware during application installation (making the "do not install" button gray and on the bottom, with the "install adware" button in black and on top, or only having the "do not install" button appear as a small hyperlink in what looks like an EULA).

Don't mix your coins someone said isn't legal
Quartx
Hero Member
*****
Offline Offline

Activity: 532



View Profile
January 17, 2015, 04:03:31 AM
 #13

Good luck with the miner incorporated game, in many countries you would probably be worse case sued or generally scanned by anti-malware as a mining trojan.

Although if you really wanted to do so, if your game is 3d intense, I would suggest using a CPU miner instead on coins like XMG
AJRGale
Hero Member
*****
Offline Offline

Activity: 728



View Profile
January 26, 2015, 11:59:29 PM
 #14

If the game has a clear statement within the licence agreement that it has such software in the game to benefit the developers, no suing is involved. Its like game developers putting advertisement in their games, if its stated in the agreement, its understood and accepted by the person installing the software.

If the statement about advertising in game is not in the agreement, and the person installing the software finds a "cola" advertisement in the game, guess who gets sued.

as pointed out, the miner only runs when the software runs, there are even websites out there that have mining software on it, and clearly stated, no one has gotten sued by that yet.

now them silly buggers that just skip over the EULA, then tries to sue them for having "hidden software" in the game, but the object stated in the EULA, guess what gets thrown out of court...

i love how this original question by OP was whether there is any software out there that they could imbed into their software, to legalities of doing it.
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!