Skip to content

Commit

Permalink
agt/infinitygems game added.
Browse files Browse the repository at this point in the history
  • Loading branch information
schwarzlichtbezirk committed Nov 21, 2024
1 parent ac09b65 commit c2d3325
Show file tree
Hide file tree
Showing 8 changed files with 596 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ Slots games server. Releases functionality for Megajack, Novomatic, NetEnt, BetS
Server provides HTTP-based API for popular slots and have well-optimized performance for thousands requests per second. Can be deployed on dedicated server or as portable application for Linux or Windows.

```text
total: 120 games, 59 algorithms, 9 providers
AGT: 38 games
total: 121 games, 60 algorithms, 9 providers
AGT: 39 games
Aristocrat: 4 games
BetSoft: 3 games
Megajack: 3 games
Expand Down
1 change: 1 addition & 0 deletions cmd/links.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ import (
_ "github.com/slotopol/server/game/slot/hotclover"
_ "github.com/slotopol/server/game/slot/iceiceice"
_ "github.com/slotopol/server/game/slot/icequeen"
_ "github.com/slotopol/server/game/slot/infinitygems"
_ "github.com/slotopol/server/game/slot/sevenhot"
_ "github.com/slotopol/server/game/slot/shiningstars"
_ "github.com/slotopol/server/game/slot/shiningstars100"
Expand Down
5 changes: 3 additions & 2 deletions docs/list-all.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
'Ice Ice Ice' AGT 3x3 videoslot
'Ice Queen' AGT 5x3 videoslot
'Indian Dreaming' Aristocrat 5x3 videoslot
'Infinity Gems' AGT 5x3 videoslot
'Irish Luck' Playtech 5x3 videoslot
'Jewels 4 All' Novomatic 5x3 videoslot
'Jewels' Novomatic 5x3 videoslot
Expand Down Expand Up @@ -123,8 +124,8 @@
'Wild Witches' NetEnt 5x3 videoslot
'Wizard' AGT 5x4 videoslot
total: 120 games, 59 algorithms, 9 providers
AGT: 38 games
total: 121 games, 60 algorithms, 9 providers
AGT: 39 games
Aristocrat: 4 games
BetSoft: 3 games
Megajack: 3 games
Expand Down
68 changes: 68 additions & 0 deletions game/slot/infinitygems/infinitygems_calc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
package infinitygems

import (
"context"
"fmt"
"time"

"github.com/slotopol/server/game/slot"
)

func CalcStatBon(ctx context.Context) float64 {
var reels = &ReelsBon
var g = NewGame()
var sln float64 = 1
g.Sel = int(sln)
g.FS = 50 // set free spins mode
var s slot.Stat

var dur = slot.ScanReels5x(ctx, &s, g, reels,
time.Tick(2*time.Second), time.Tick(2*time.Second))

var reshuf = float64(s.Reshuffles)
var lrtp, srtp = s.LinePay / reshuf / sln * 100, s.ScatPay / reshuf / sln * 100
var rtpsym = lrtp + srtp
var q = float64(s.FreeCount) / reshuf
var sq = 1 / (1 - q)
var rtp = sq * rtpsym
fmt.Printf("completed %.5g%%, selected %d lines, time spent %v\n", reshuf/float64(s.Planned())*100, g.Sel, dur)
fmt.Printf("reels lengths [%d, %d, %d, %d, %d], total reshuffles %d\n",
len(reels.Reel(1)), len(reels.Reel(2)), len(reels.Reel(3)), len(reels.Reel(4)), len(reels.Reel(5)), reels.Reshuffles())
fmt.Printf("symbols: %.5g(lined) + %.5g(scatter) = %.6f%%\n", lrtp, srtp, rtpsym)
fmt.Printf("free spins %d, q = %.5g, sq = 1/(1-q) = %.6f\n", s.FreeCount, q, sq)
fmt.Printf("free games frequency: 1/%.5g\n", reshuf/float64(s.FreeHits))
fmt.Printf("RTP = sq*rtp(sym) = %.5g*%.5g = %.6f%%\n", sq, rtpsym, rtp)
return rtp
}

func CalcStatReg(ctx context.Context, mrtp float64) float64 {
fmt.Printf("*bonus reels calculations*\n")
var rtpfs = CalcStatBon(ctx)
if ctx.Err() != nil {
return 0
}
fmt.Printf("*regular reels calculations*\n")
var reels, _ = slot.FindReels(ReelsMap, mrtp)
var g = NewGame()
var sln float64 = 1
g.Sel = int(sln)
var s slot.Stat

var dur = slot.ScanReels5x(ctx, &s, g, reels,
time.Tick(2*time.Second), time.Tick(2*time.Second))

var reshuf = float64(s.Reshuffles)
var lrtp, srtp = s.LinePay / reshuf / sln * 100, s.ScatPay / reshuf / sln * 100
var rtpsym = lrtp + srtp
var q = float64(s.FreeCount) / reshuf
var sq = 1 / (1 - q)
var rtp = rtpsym + q*rtpfs
fmt.Printf("completed %.5g%%, selected %d lines, time spent %v\n", reshuf/float64(s.Planned())*100, g.Sel, dur)
fmt.Printf("reels lengths [%d, %d, %d, %d, %d], total reshuffles %d\n",
len(reels.Reel(1)), len(reels.Reel(2)), len(reels.Reel(3)), len(reels.Reel(4)), len(reels.Reel(5)), reels.Reshuffles())
fmt.Printf("symbols: %.5g(lined) + %.5g(scatter) = %.6f%%\n", lrtp, srtp, rtpsym)
fmt.Printf("free spins %d, q = %.5g, sq = 1/(1-q) = %.6f\n", s.FreeCount, q, sq)
fmt.Printf("free games frequency: 1/%.5g\n", reshuf/float64(s.FreeHits))
fmt.Printf("RTP = %.5g(sym) + %.5g*%.5g(fg) = %.6f%%\n", rtpsym, q, rtpfs, rtp)
return rtp
}
34 changes: 34 additions & 0 deletions game/slot/infinitygems/infinitygems_link.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
//go:build !prod || full || agt

package infinitygems

import (
"github.com/slotopol/server/game"
"github.com/slotopol/server/util"
)

var Info = game.GameInfo{
Aliases: []game.GameAlias{
{Prov: "AGT", Name: "Infinity Gems"},
},
GP: game.GPsel |
game.GPretrig |
game.GPfgreel |
game.GPscat |
game.GPwild,
SX: 5,
SY: 3,
SN: len(LinePay),
LN: len(BetLines),
BN: 0,
RTP: game.MakeRtpList(ReelsMap),
}

func init() {
game.GameList = append(game.GameList, &Info)
for _, ga := range Info.Aliases {
var aid = util.ToID(ga.Prov + "/" + ga.Name)
game.ScanFactory[aid] = CalcStatReg
game.GameFactory[aid] = func() any { return NewGame() }
}
}
Loading

0 comments on commit c2d3325

Please sign in to comment.