216 lines
6.9 KiB
GDScript
216 lines
6.9 KiB
GDScript
extends Control
|
|
|
|
var gamename = ""
|
|
var review_tolerance = 7 #What's the lowest percent off that reviewers are willing to overlook
|
|
|
|
var data = {
|
|
"devstart":[1,1,1988],
|
|
"Phase":0,#0=start,1-3 = actual phases, 4 = debug phase/release prep
|
|
"phasetime":2,
|
|
"timer":3,
|
|
"targetaudience":"Everyone",
|
|
"platforms":["Commadare64"],
|
|
"genres":["Action"],
|
|
"themes":["Castle"],
|
|
"engine":"Texty",
|
|
"Engine":34,
|
|
"Gameplay":33,
|
|
"Story":33,
|
|
"Dialog":34,
|
|
"Level Design":33,
|
|
"AI":33,
|
|
"World Building":34,
|
|
"Graphics":33,
|
|
"Sound":33,
|
|
"Engine_Flags":["TextGraphics"],
|
|
"Game_Tags":["openworld"]
|
|
}
|
|
|
|
var genre_tally = {#To compare phase dev time
|
|
"Action":{
|
|
"Engine":41,
|
|
"Gameplay":54,
|
|
"Story":5,
|
|
"Dialog":5,
|
|
"Level Design":51,
|
|
"AI":41,
|
|
"World Building":5,
|
|
"Graphics":54,
|
|
"Sound":41},
|
|
"Adventure":{
|
|
"Engine":5,
|
|
"Gameplay":31,
|
|
"Story":64,
|
|
"Dialog":48,
|
|
"Level Design":48,
|
|
"AI":4,
|
|
"World Building":64,
|
|
"Graphics":31,
|
|
"Sound":5},
|
|
"RPG":{
|
|
"Engine":14,
|
|
"Gameplay":29,
|
|
"Story":57,
|
|
"Dialog":45,
|
|
"Level Design":45,
|
|
"AI":10,
|
|
"World Building":57,
|
|
"Graphics":29,
|
|
"Sound":14},
|
|
"Simulation":{
|
|
"Engine":63,
|
|
"Gameplay":31,
|
|
"Story":6,
|
|
"Dialog":5,
|
|
"Level Design":63,
|
|
"AI":31,
|
|
"World Building":31,
|
|
"Graphics":38,
|
|
"Sound":31},
|
|
"Strategy":{
|
|
"Engine":41,
|
|
"Gameplay":54,
|
|
"Story":5,
|
|
"Dialog":9,
|
|
"Level Design":30,
|
|
"AI":61,
|
|
"World Building":33,
|
|
"Graphics":33,
|
|
"Sound":34},
|
|
"Casual":{
|
|
"Engine":9,
|
|
"Gameplay":83,
|
|
"Story":8,
|
|
"Dialog":8,
|
|
"Level Design":83,
|
|
"AI":9,
|
|
"World Building":4,
|
|
"Graphics":48,
|
|
"Sound":48},
|
|
}
|
|
|
|
var scores = [5,5,5,5]
|
|
var final_score = 5
|
|
|
|
## Calculate
|
|
func calc_score():#calculation the scores
|
|
var i = 0
|
|
var themres = $"/root/loader".load_json(ProjectSettings.get("Game/Resources/Themesmod"))
|
|
var platres = $"/root/loader".load_json(ProjectSettings.get("Game/Resources/Platformsmod"))
|
|
while(i<scores.size()):
|
|
var possible_comments = []
|
|
var scorecalc = -1
|
|
# Different personalities for each reviewer
|
|
var personalmultiplier = 1
|
|
match(i):
|
|
0:#Likes RPGs and adventure games, dislikes casual
|
|
if(data["genres"].has("Adventure")||data["genres"].has("RPG")):
|
|
personalmultiplier+=0.5
|
|
if(data["genres"].has("Casual")):
|
|
personalmultiplier-=0.75
|
|
possible_comments.append("Personally I dislike the genre.")
|
|
1:#By default is hard to please, but loves action and casual games
|
|
personalmultiplier-=0.5
|
|
if(data["genres"].has("Action")||data["genres"].has("Casual")):
|
|
personalmultiplier+=0.5
|
|
2:#Simulation and strategy, funtime. Not big fan of action
|
|
if(data["genres"].has("Strategy")||data["genres"].has("Simulation")):
|
|
personalmultiplier+=0.25
|
|
if(data["genres"].has("Action")):
|
|
personalmultiplier-=0.25
|
|
possible_comments.append("I typically hate these type of games.")
|
|
3:#Unstable
|
|
personalmultiplier+=1
|
|
#Is it a good genre/theme matchup
|
|
for genre in data["genres"]:
|
|
for them in data["themes"]:
|
|
if(scorecalc==-1):
|
|
scorecalc = themres[them][genre]
|
|
if(scorecalc>7):
|
|
possible_comments.append(genre+"/"+them+" Is good combo")
|
|
elif(scorecalc>4):
|
|
possible_comments.append(genre+"/"+them+" Is a nishe")
|
|
else:
|
|
possible_comments.append(genre+"/"+them+" Is a bad combo")
|
|
possible_comments.append(genre+"/"+them+" Is a terrible combo")
|
|
else:
|
|
if(scorecalc>themres[them][genre]):
|
|
scorecalc+=(1*personalmultiplier)
|
|
possible_comments.append(genre+"/"+them+" Is good combo")
|
|
possible_comments.append(genre+"/"+them+" Is a fun combo")
|
|
else:
|
|
scorecalc-=(1*personalmultiplier)
|
|
if(i==3):
|
|
personalmultiplier-=0.1
|
|
possible_comments.append(genre+"/"+them+" Isn't really a good combo")
|
|
#& is it a good targetaudience/theme match
|
|
if(themres[them]["targetaudience"]==data["targetaudience"]):
|
|
scorecalc+=(1*personalmultiplier)
|
|
possible_comments.append("The "+data["targetaudience"]+" crowd will enjoy the "+them+" theme.")
|
|
possible_comments.append("The theme should not be rated for "+data["targetaudience"]+" audience.")
|
|
possible_comments.append(them+" doesn't work with targeted audience.")
|
|
else:
|
|
scorecalc-=(1*personalmultiplier)
|
|
if(i==3):
|
|
personalmultiplier-=0.1
|
|
#is it a good targetaudience/platform match
|
|
for plat in data["platforms"]:
|
|
if(platres[plat]["Targetaudience"]==data["targetaudience"]):
|
|
scorecalc+=(1*personalmultiplier)
|
|
possible_comments.append(plat+" has just right audience")
|
|
possible_comments.append(data["targetaudience"]+" Works for the platform.")
|
|
else:
|
|
scorecalc-=(1*personalmultiplier)
|
|
if(i==3):
|
|
personalmultiplier-=0.1
|
|
possible_comments.append("What do they think the "+plat+" audience is?")
|
|
possible_comments.append("I don't see how the platform works with "+data["targetaudience"])
|
|
#Does the phases match the genre?
|
|
var genre_collab = genre_tally[data["genres"][0]] #Combines the values of the data genres so it compares the whole, instead off-balancing one, and condemning the rest.
|
|
for genre in data["genres"]:
|
|
if(genre != data["genres"][0]):#We've already added the first genre to the genre_collab
|
|
for devtime in genre_tally[genre]:
|
|
genre_collab[devtime]+=genre_tally[genre][devtime]
|
|
for devsection in genre_collab:#Now to actually Compare the phases to the (multi-)genre
|
|
var compare = genre_collab[devsection]/data["genres"].size()
|
|
print_debug(abs(data[devsection]-compare))
|
|
if(abs(data[devsection]-compare)<review_tolerance):
|
|
scorecalc+=(1*personalmultiplier)
|
|
possible_comments.append(devsection+" Works extremely well with the genre")
|
|
possible_comments.append("Had no problems with the "+devsection)
|
|
possible_comments.append("Really good "+devsection)
|
|
else:
|
|
scorecalc-=(1*personalmultiplier)
|
|
if(i==3):
|
|
personalmultiplier-=0.1
|
|
possible_comments.append("The #### is this "+devsection+"?")
|
|
possible_comments.append(devsection+" is awful")
|
|
possible_comments.append("I want to punch the person who was in charge of the "+devsection)
|
|
possible_comments.append("The "+devsection+" makes me question my sanity.")
|
|
#How many bugs the game has to design/techpoints WIP
|
|
#The total of design/tech points compared to the market avg. WIP
|
|
|
|
var comment = possible_comments[randi()%possible_comments.size()]
|
|
scorecalc = clamp(scorecalc,0,10)
|
|
var stagger = randi()%1-randi()%3
|
|
scores[i] = clamp(scorecalc+stagger,0,11)
|
|
set_lb_text(scores[i],$Reviewquips.get_child(i),comment)
|
|
i+=1
|
|
final_score = (scores[0]+scores[1]+scores[2]+scores[3])/4
|
|
|
|
## Display
|
|
func set_lb_text(val,who,note):
|
|
who.text = str(val) + "/10 " + note + " -"+who.name
|
|
|
|
func send_review_scores():
|
|
get_parent().get_parent().games[gamename]["score"] = final_score
|
|
queue_free()
|
|
|
|
## MAIN
|
|
func _ready():
|
|
$gname.text = "Reviews for "+gamename
|
|
calc_score()
|
|
var connections = [
|
|
$confirm.connect("pressed",self,"send_review_scores")
|
|
]
|
|
print_debug(connections) |