forked from kgilbert-cmu/basketball-gm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTODO
674 lines (627 loc) · 36.1 KB
/
TODO
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
DB CHANGES SINCE 3.2.0
----------------------
g.nextPhase, but this doesn't matter because it's initialized when it's needed
g.daysLeft, but this doesn't matter because it's initialized when it's needed
BIG NEW FEATURES
----------------
fantasy draft
right after starting a fantasy draft, dashboard gives an error since there are no players on team
any other errors?
all time leaders page
team switching after being fired
2 year grace period in message.js, like with a new league?
intro message from new owner, like a new league?
rename g.gameOver
keep track of what team the user controlled, so stats for the user (not the team) can be shown
more starting options
"equalize cities" under teams - set all to same population
implications for popRank?
localization
http://requirejs.org/docs/api.html#i18n
BIG NEW GAMEPLAY CHANGES
------------------------
somehow, don't let the user's team sign any/all free agents they want
extended free agency
30 days. play menu options: day, week, month, until blah
need some indicator of length of free agency, probably on free agents page
make statuses more like gameSim (Idle when doing nothing)??
initialize g.daysLeft if not set when used
randomize "won't negotiate with you" more and have it decay throughout free agency, so that at some point a player will be willing to sign
show mood in more detail than binary refuses or not
make genBaseMoods lower?
randomize team signings more in free agency
http://www.reddit.com/r/BasketballGM/comments/1jrv3a/have_we_discussed_the_draft_pick_exploit_yet/
fix contracts, signing
goal: reasonable total payrolls, no good free agents left every season
if WS distribution matches NBA, then look at $ vs WS. even better, build a multivariate model with age
revamp position assignment algorithm
until a player is ~28 (whenever ratings decline starts), recalculate every year
gameSim
balance http://www.reddit.com/r/BasketballGM/comments/1jfcjw/game_imbalance_fc_with_rdi/ http://www.reddit.com/message/messages/1097mj
http://www.reddit.com/r/nba/comments/1j1e6q/i_made_a_singleplayer_basketball_management/cbfzr43?context=3 http://www.reddit.com/r/BasketballGM/comments/1k1881/pf_stands_for_powerful/
too easy to get high percentage inside looks even with a team of all bigs?
or should some of the "bigs" really be smalls, just mislabeled as PFs?
make it less easy to get high percentage shots if there is no ball handling
tweak perimFactor and synergyFactor.
increase turnovers, particularly if perimFactor (or similar) is low
increase fouls if perimFactor (or similar) is low
better foul logic - shouldn't just have big slow shot blockers fouling out
also, other players shouldn't get 0 fouls. make it a bit more evenly distributed
assists should be function of speed, since those players have the ball more
substitutions should be based on "value", not ovr
but player.value includes potential.. so just come up with new formula
MINOR FIXES
-----------
twitter/facebook/g+ interfere with dropdown when loading
only show when Share is clicked?
merge game.play and freeAgents.play
HOF working consistently?
http://www.reddit.com/r/BasketballGM/comments/1osxg3/free_agents_who_arent_signed_to_a_team_dont_make/
per 36 stats in player pages http://www.reddit.com/r/BasketballGM/comments/1ofz6s/per36_stats/
g+ button flashes before it's hidden
make sure the changes alert and the "refuses to negotiate" alert both look good
link to player in "refuses to negotiate" alert
replace random.gauss with random.realGauss
update HACKING.md
show EWA more places
team history
hall of fame
raphael is big - can i rewrite faces.js to not use it?
hall of fame - add career totals columns?
trade deadline
http://requirejs.org/docs/api.html#config-waitSeconds
current season shouldn't show in league history page dropdown
team.valueChange
contending teams shouldn't always see every player as a positive value. needs to be some balanced formula where a bad contract is a negative.
player.value
player value shouldn't rely only on raw stats, because teammates heavily influence stats
add some fudge factor to discout PER on good teams and inflate it on bad teams
too easy to trade for young prospects with no stats http://www.reddit.com/r/BasketballGM/comments/1lkv5m/utah_jugglers/
options:
1. add fudge factor to make teams less willing to trade away young players without much game experience
2. just increase the value for ovr in player.value (try this now)
is there a better function than 4 * PER to map between PER and ovr? plot.
AI teams playing with under 5 players http://www.reddit.com/r/BasketballGM/comments/1l3od6/glitch_just_had_a_cpu_team_play_a_whole_season_w/
AI teams should never drop below 5 in regular season http://www.reddit.com/r/BasketballGM/comments/1l3od6/glitch_just_had_a_cpu_team_play_a_whole_season_w/cbvzngs
no min roster limit in trades?
awards
assigned based on wins added, like hof
store EWA in database, update when PER is updated in advStats
use in player.madeHof
formulas:
overall: linear combination of EWA and team wins
defensive: basically same stupid shit as now, but make sure to account for games played
show awards count in hall of fame
player contract amounts http://www.reddit.com/r/BasketballGM/comments/1kj0p0/can_i_turn_off_firing/cbpxjyj?context=3
make it less likely that players refuse to resign with winning teams
show annual ratings changes in roster page
green (up) or red (down) with the number ovr and pot changed, in parentheses
then, on switch to preseason, redirect to current roster
when viewing a url like /l/1/roster, playing until new season shouldn't move it to roster for previous year
this happens because inputs.season gets set even though it's not present in the URL. elegant solution?
add function to delete old box scores (older than, say 5 years) to debug menu, to save space
make trade counter-offer faster by checking if no trade is possible first http://www.reddit.com/r/BasketballGM/comments/1jumc9/is_it_just_me_or_does_it_take_wayyyy_too_long_for/
document things that affect player mood
contracts should take ratings into more account, since stats on a good team are inflated and stats on a bad team are depressed
show four factors somewhere
show attendance in box score
security
validate any user-added content, like custom team names (both in file and through form), custom players, and league names
in playoffs, replace "play week" with "play until end of round"
"Watch list" of players the user is interested in
IE11 testing
LOW PRIORITY
------------
salary cap exception? too complicated?
how much?
who gets it? only if over cap when free agency starts?
messages about it
anywhere salary cap is displayed, including team finanaces
contract negotiation - show warning if the exception will be used
resigning players page
update manual
implementation
flag in root of team object - exception available, exception used, exception not granted this season
fantasy draft
when fantasy draft is over, go to summary of the draft
do this in core.draft.untilUserOrEnd
make tables sortable
add entry for fantasy draft summary to draft history dropdown?
league settings
enable buy out button or not
set salary cap, luxury tax, exceptions, etc
enable/disable trading rules
appcache
loads from network unless network is not available, because fallback only runs when the network is not available. so the cached versions of files are only used when it is offline. would be better/faster to use them even when online, but that's not possible until the appcache standard is updated unless i either (1) cache every page (way too much) or (2) use hash # urls instead of real URLs (ugly).
some kind of more detailed UI/menu exposed in the lg view, maybe a sidebar like the old layout
cross-league play
mobile UI, bootstrap 3
do something about hover tooltips
injury
skills
for injury and skills, maybe make the whole block a hyperlink that opens a popover
make sure to use on player page too.. can i use helpers.playerName.. there too?
table headers
others?
get rid of leagueLayout.html
any columns: *em css - can't i make columns use bootstrap?
achievements that span leagues, or milestones: http://www.reddit.com/r/BasketballGM/comments/1jb8d6/milestones/
Moneyball
bronze: win a title with a payroll under $40 million
silver: win a title with a payroll under $30 million
gold: win three consecutive titles a payroll under $30 million
Fo Fo Fo
bronze: go 16-0 in the playoffs
silver: go 16-0 in the playoffs three times in a row
gold: go 16-0 in the playoffs five times in a row
98 Degrees
bronze: go 98-0 in the playoffs and regular season
silver: go 98-0 in the playoffs and regular season three times in a row
gold: go 98-0 in the playoffs and regular season five times in a row
Dynasty
bronze: win 6 championships in 8 years
silver: win 10 championships in a row
gold: win 30 championships in a row
Messed Around
bronze: win a title with a player averaging a triple double
silver: win two consecutive titles with a player averaging a triple double
gold: win three consecutive titles with a player averaging a triple double
some kind of playoff series overview page, including box scores for easy access
luxury tax money should be redistributed to non-taxpaying teams (or teams under the cap?)
jslint errors
currently just "Don't make functions within a loop." which should all be fixed eventually
can I get rid of all the "is OK" lines?
jshint?
A year-to-date comparison of team finances with the previous year.
better core.player.ovr formula
regression: player = require('core/player'); player.regressRatingsPer();
weight by minutes played
THIS NEEDS TO BE UPDATED WHEN PLAYER GENERATION/DEVELOPMENT OR GAMESIM CHANGES!
team names from db
g.teamNamesCache and g.teamRegionsCache and g.teamAbbrevsCache - update this when appropriate
store region and name in meta so it can be shown on dashboard
update this when changed on customize screen
option to load from JSON file on "Edit Team Info"
export rosters should include teams
option to include just team names or just players
should update popRank when custom teams are supplied
not so simple to allow abbrevs to be changed, since they are used elsewhere for convenience - damn indexeddb and denormalization!
make edit_team_info prettier
popRank never updates, but I don't think it matters.
different owner personalities, with different priorities
trades
"undo" button for accidental trades
transaction log first. put "Undo" button after message from other GM only right after a trade finishes. make sure it doesn't show up at other time
only allow undo if dbChange hasn't changed since the transaction was logged
too easy to trade for yougn stars: http://www.reddit.com/r/nba/comments/1j1e6q/i_made_a_singleplayer_basketball_management/cbaayir http://www.reddit.com/r/BasketballGM/comments/1k1stt/traded_a_2017_2nd_rounder_for_the_1_pick/
maybe weight potential higher for players with no stats, or this could depend on age
draft pick value needs to be reassessed: http://www.reddit.com/r/BasketballGM/comments/1j2mag/ive_gotten_pretty_good/cbajbz6?context=3 http://www.reddit.com/r/nba/comments/1j1e6q/i_made_a_singleplayer_basketball_management/cbb3l2q http://www.reddit.com/r/BasketballGM/comments/1j4evq/new_version_311_uploaded/cbbbc0p?context=3
"When signing free agents, if you offer then a contract 2 years longer/shorter than the one they want, they'll counter offer one with 1 more/less year. If you offer the same amount of money you previously offered, and change the year to what they want, they'll automatically offer the lowest $ for that amount of years."
shouldn't be able to immediately trade away players you just acquired
transaction log
put index on pids involved, so then events involving a player can be shown on player page
Finals MVP
more detailed player moods - http://www.reddit.com/r/BasketballGM/comments/1k4val/players_refusing_to_sign_bug/cbln1oo?context=3
more detailed draft - slower picks, trades, etc.
strategy shouldn't be set randomly at start of new league
AI teams need to get smarter about projecting the value of future draft picks: http://www.reddit.com/r/BasketballGM/comments/1jzel1/very_helpful_hint_regarding_tanking_and_draft/
dashboard info should be on a widget accessible from any screen
some UI indicating how players developed over the offseason
integrated into roster, or separate page?
player search page
show stats, ratings, contract, etc. (customizable); allow filters to be applied. also filter by skill icon
finances - too easy to make big $$$
player morale - punishment for tanking
player personality, team chemistry
team colors, and uniforms in player icons
rookies are too good
fire GM before draft?
harsher, more realistic luxury tax
midlevel exception
playerNameLabels should also put a little hover box over the player link with key stats/ratings
more refined control of playing time: http://www.reddit.com/r/nba/comments/1j1e6q/i_made_a_singleplayer_basketball_management/cbaegpq
signing draft picks should be optional
maybe sign them in the "resign players" phase
you should be able to drop below 5 players (and above 15) but only temporarily (no game simulation in that time)
fake feet/inches heights should be taller
some players want to resign for infinite money?
draft
randomness in picks should factor in relative ratings http://www.reddit.com/r/BasketballGM/comments/1l1713/the_draft_still_needs_some_work_it_seems_my/cbutw7v?context=1
there should be some indication about the quality of upcoming drafts, which would influence how players/AI value draft picks
somehow allow uploading of custom draft classes
more visibly promote subreddit
auto sort roster based on value
"rookie contracts" when a new game is started should be bounded at 5 million. so do bound at 20 million before dividing by 4.
sourcemaps putting blank line in front of each file?
trades between AI teams
each day, pick two random teams. if a trade can be found that both teams like, do it
generalize core.trade.makeItWork and other parts of core.trade
transaction log is necessary to keep tabs on this stuff
also propose trades to the user, somehow
user can't just sign all the free agents before AI teams
"coaches" should factor in synergy in gameSim substitutions
also, base it on value, not ovr
IE10 support
dropdowns disappear on refresh?
unit tests fail too, seemingly for the same reason
text in dashboard is messed up
core.team.valueChange should be used to pick which free agents to # core.freeAgents.autoSign, but that would be a bitch beacuse of how transactions are set up
also for resigning players in core.season
revamp core.team.valueChange
simpler formulas for rebuilding/contending team values
trades
fancy scrolling of summary box, or some better UI
refactor core.trade. it's an utter mess.
cash
otherCash and userCash containing the amount
estimate value of cash - different for different teams? depending on cash, net profit recently, and market size
upper limit? what is NBA rule?
more feedback from AI
if trade is close/far from working, return different messages
display some indication of what a team wants to do on the trade view, e.g.
"I need to cut my payroll and start making more money."
"I could really use a good rebounder."
all star game
team and league records (highest scoring game, etc)
switch teams after you're fired
trades
allow trades to go over the roster limit, but show a warning. also factor into AI logic that they would have to drop a player
warning should be in a different color than the error-like warnings
after trade, AI drops player immediately
don't allow game simulation if player's team is over limit - currently this is only checked at the beginning of the season, right?
sign and trade (only during resigning phase)
profits too large, too easy
add corporate tax?
luxury tax increases for repeat offenders?
only show retired players in season summary if they actually played some
Look at ratings distributions - should there really be so many bigs who are great passers, for instance?
components.dropdown tests are very slow in chrome
export/import roster
some way to specify startingSeason
download link performance
http://mjtemplate.org/examples/rison.html
something besides a data URI?
no base64? Firefox can't handle #
error handling if blank or invalid file is supplied
easily edit in excel?
http://blog.stevensanderson.com/2013/05/20/knockout-es5-a-plugin-to-simplify-your-syntax/
move most db functions into core.whatever. db should just be about initializing/upgrading
get rid of "db" module dependence
core.freeAgents should be core.freeAgent or core.freeAgency?
after last resigning negotiation, switch to next phase?
draft lottery
do a dramatic presentation?
increase hype for teams that exceed expectations
tied records?
how to handle aggregating stats for players who played for more than one team in a season? add them all up in ps in db.getPlayers
for roster, want just a player's stats with this team this season
this currently works, just pass a tid
for player stats view, want total among all teams for one season
no pass tid and you only get the latest row. need added logic to do sum
for player view, want separate and combined rows in careerStats without fucking up totals (including PER)
no pass tid and you get each team separately, but no merged stats as above
better default league name
contracts
maybe make them nonlinear.. role players lower, stars higher
compare to NBA contract distribution
luxury tax should be disbursed amongst non-taxpaying teams
give bbgm website its own version of bootstrap (only with components needed)
team.rosterAutoSort should automatically set dbChanged, and have an option to not if that's important
test trades more
multi-player valuation
rank players by value. each additional value gets some multiplier to diminish its influence. this prevents adding a player to a trade from decreasing its value
but this should have something to do with the difference between numbers of players on each side?
analytics
should have no more referrals from basketball-gm.com since it's all set to the same domain now
https://github.com/segmentio/analytics.js/
analytics.pageview in lib/davis.google_analytics.js
analytics.track to get rid of bbgmPing
how to initialize GA with correct options?
notifications (and log) from top right to display log of key events
game results from user's team
players retiring from user's team
league champions
trades
free agent signings
how to deal with a team that drops below 5 active players, factoring in injuries?
should minimum roster size be higher?
should allow them to exceed roster limit while injury exists
should not allow play when below 5
should use same logic/functions as core.season that checks on new season.
first, add support for auto-add players when AI teams are below limit (in season.js)
if fouling out drops team below 5, play fouled out players but add a FT each foul (technical)
check effects of extreme ticket prices
show old contracts on old roster view
reassess ui module. delete stuff like ui.dropdown. move other functions elsewhere?
what is the difference between util.viewHelpers, views.components, and ui?
can i get rid of js/api.js?
core.trade refactoring
validateSavedTids crap should be in trade.js.
trade.summary stuff should be automatic and stored in tradeStore
trade and clear buttons should be disabled during gameSim, wiht message like in team finances
too easy to do the "be bad, get draft picks, keep payroll low, sign free agents, be good" pattern
free agents are even less willing to sign with the user, even if it's a good team
final score, hall of fame
influenced by size of city (see: difficulty in views.newLeague)
any raw data files should go in the data folder, ideally with a script to convert them to however they're used here
database changes
add activeYears multientry like statsTids use for:
league leaders
stats
ratings
gameSim
more penalty for really unbalanced rosters: http://www.reddit.com/r/nba/comments/1j1e6q/i_made_a_singleplayer_basketball_management/cba743c?context=3
rename compositeRating to compositeRatings (or something better)
other plural issues in gameSim
playing time not adding up to 240?
do some kind of profiling, see if i can speed it up
any way to speed up PER? maybe break it up into smaller functions so they can be profiled
do i need all the player composite ratings?
do i need all the team composite ratings?
how does performance change/degrade as the years go on?
bench players should get minutes in blowouts
in lock functions, update g from database before using any potentially sensitive values
or should these g.whatever variables be set at all if they're sensitive? lid doesn't change obviously, but the others?
move to new window button, like gmail, that will open a view in a new window with a minimal UI
only the icon should be clickable, not the area above and below
AI modules that contain functions which are called to determine actions
things to regulate...
draft picks
signing free agents
resigning players
trades
budget items (like from team finances view)
releasing/buying out players when over limit
player finder
search by stats or ratings
trade for button, or sign button if free agent
customize which columns are shown in roster view (and possibly other summary views like trade, free agent, etc)
http://datatables.net/extras/colvis/
PER
slow, particularly after multiple seasons?
can i have it share a transaction with writing stats in core.game?
some UI showing the state of the team's synergy. maybe like an advisors screen that suggests what kind of player is needed to improve synergy
also can respond to budget changes
more handlebars helpers for things like...
team dropdown
season dropdown
DataTables - fix default sort order on column click
text should be asc, numeric should be desc (except draft picks)
http://datatables.net/ref#asSorting will work. maybe pass it as an option to bbgm_datatable
but can it be set globally, based on column type? can have ui.datatable automatically read columns and figure it out?
more tests
https://github.com/gotwarlost/istanbul
https://github.com/metagriffin/indexeddb-js can i improve this and run tests outside of browser?
like on team finances page, anywhere else to add help popups?
should this be abstracted rather than just inline in views?
inline anything from the manual?
tweak gameSim for stats again
freeAgentMoods should affect AI team signings - or should it?
for resigning players
for signing free agents
AI updating of *Budgets and ticket prices
maybe not necessary at this stage?
call core.finances.updateBudgetRanks() after
update formulas
nationalTvRevenue
same for each team, change contract year by year and display in team finances
localTvRevenue
eventually, t.seasons[0].tvContract
preview strength of the draft, free agent class
FUTURE
------
double season: http://www.reddit.com/r/BasketballGM/comments/1kja6e/so_my_league_decided_to_have_an_extended_season/
IE10 support
davisjs for knockoutjs links in IE10
elem.host comes up blank in originChecks
hacky solution used now (see js/lib/README.md) but maybe this will lead to a real answer: http://stackoverflow.com/q/17641380/786644
http://www.reddit.com/r/BasketballGM/comments/1kj8nv/i_have_updated_firefox_but_the_game_wont_load_in/
hire/fire different coaches with different strategies
Web workers
don't seem to actually help performance. maybe help responsiveness
benchmark?
would it be worth it to parallelize advstats?
boxplots for shot location stats, plus comparison to NBA data
import/export stuff
online "locker" that you can sync saved games to
https://unhosted.org/adventures/7/Adding-remote-storage-to-unhosted-web-apps.html
data urls don't work with more than ~1 MB. downloadifydoesn't seem to work with more than several MBs of data. until a better solution comes (online sync?), wait.
league names
"Edit" button between "Export" and "Delete" - set in leaguesStore and gameAttributes
move delete/edit/export under one button, "manage". have the 3 buttons pop out in place when you hit manage, then it functions as it does now. popped buttons can be colored too, then
import league
ignore old lid
other advanced stats
WS - http://www.basketball-reference.com/about/ws.html requires Basketball on Paper - http://www.sports-reference.com/cbb/about/ws.html is simpler
+/- and other stats needed to calculate above - track in game
APM?
hitting the phase twice shouldn't be possible. but if i, for instance, hit "until preseason" twice quickly, i skip a year
maybe have something like lock.phaseChangeInProgress? but some timeout would be needed to reset
worth it to switch to closure library? http://stackoverflow.com/questions/10782612/what-is-the-sturdiest-way-to-get-the-closure-compilers-type-safety-together-wit
roster size check on new season
cpu teams with < 5 players should automatically sign free agents
moving to other cities
expansion teams (add population growth, expand when certain conditions are met)
team finances view
compare bar graphs against league averages?
different size stadiums, building new stadiums
tv revenue as a variable
local tv contract - $10 million
base on tvContractAmount, tvContractExp
will be a deal from 3 to 5 years in length
based on...
region population
"hype"
random noise
"random event" - competition between two networks, Sports TV and The Basketball Channel
when renegotiating and really bad, the guy pretends not to know you - "Atlanta Herons? Is that the team from the Mexican/Canadian/Arena/Indoor/Xtreme Volleyball/Soccer/Tennis/Racing/Curling/MudWrestling League?"
stat views
add team dropdown to ratings and stats views - but should this refresh the view, or just filter the DataTable?
could use something like http://www.datatables.net/extras/thirdparty/ColumnFilterWidgets/DataTables/extras/ColumnFilterWidgets/ to also filter on positions
playoff/regular season toggle in team/player stats, league leaders
player stats: toggle to only show players > 2000 minutes http://www.nba.com/leader_requirements.html
per 36 stats in team/player stats view, league leaders
add a dropdown (maybe make the dropdown handling code more general?)
bootstrap 2.3
https://github.com/nprapps/app-template
race conditions associated with callbacks when passing around transactions
any put/add/update does not guarantee it's finished until the transaction finishes. but letting transactions finish is slow.
contract negotiation
don't have counter-offers be too drastic
weirdness http://www.reddit.com/r/nba/comments/1j1e6q/i_made_a_singleplayer_basketball_management/cbabaq1 http://www.reddit.com/r/BasketballGM/comments/1j3it8/free_agency_bug/
add free agent to the end of roster
eliminate jquery UI dependency? it's only used for roster reordering currently
real calendar
player.injury.gamesRemaining
core.gameSim.updateSynergy should produce continuous output
no big difference between a 80 rating and 79 rating, or whatever
input to helpers.formatCurrency (and all currency in variables everywhere) should be in 1000s of dollars and then only converted to millions when displayed
AI teams should have to deal with fuzz too
if play menu is open when it refreshes, automatically open it again after refresh
not so easy.. tried it in 34927959b2b0acd08224665654343d97ffaea281 but there were issues with updatePlayMenu being called multiple times, for instance at the end of the season
"dbChanged" updateEvent - more correct way
store a list of times and "update events". compare last updated time against that list, and then see the update events. pass as list in "update event" to realtime update
check everywhere dbChange or lastDbChange is set and see if it should be more refined
add playerMovement updateEvent, for when a player signs a contract, becomes a free agent, or is traded
bbgmView
can i do some check to abandon display if idLoading is mismatched with reality? like for clicking a slow link followed by a fast link, in rapid succession, the fast output should show and the slow should be short circuited.
in practice, this doesn't seem to matter much
shouldn't have newPhase updateEvent doing much. instead, have an array of what changed in that phase
(updateEvents.indexOf("newPhase") >= 0 && g.phase === g.PHASE.PRESEASON) should be newSeason
use req.redirect from POST to manage history optimally
make it less tied to BBGM specifically. shouldn't depend on BBGM-specific modules like g, ui, and util/viewHelpers
player development should depend on playing time
http://code.google.com/p/htmlcompressor/ or something similar
core.player.ovr shouldn't just average ratings together. some ratings are more important than others. do regression analysis against PER to prove this and find a better formula.
player.filter
the special case attributes should generally be moved directly into the database?
views.teamFinances should merge db call with team.filter to get seasonAttrs, but that will require rewriting seasonAttrs handling in team.filter to handle multiple seasons.
Template Stuff
--------------
Below are relatively boring/minor improvements that would make the templating slightly better/faster/clearer/whatever.
gameLog
boxScore should be observable, but nothing inside should be except gid
dashboard
observables set right by mapping
historical things (old scores, old records) don't need to be observable?
arrays need correct keys
team finances
smarter updating of player salaries table: contracts should only update on playerMovement
feasible to use knockout for updating datatable? or kogrid?
trade - not fully knockoutifieid
mapping to update summary.teams.trade, userRoster, otherRoster
can i do a redirect from post without refreshing everything?
just call ui.realtimeUpdate which should allow for smart handling
if trade is accepted/cleared, playerMovement will instigate a refresh of rosters
if trade is proposed, message will somehow explicity be sent (set in VM? but what if VM not initialized?)
when to delete stored message?
at beginning of new propose
on clear
when team changes
changing the trading partner shouldn't refresh the user's team
negotiation
some things can probably be non-observable
draftSummary
don't show this season as option if before draft - have an option in components.dropdown
playerNameLabels always updates even if none of the inputs did - why
if ratings.skills is generated by the mapping plugin, it's an observable array and this fucks things up. it would be a bitch to fix, though.
quick fix - return a string for templates rather than array.
leaders
flatten a bit
roster
check release, buy out, trade for
flatten a bit
vars.ptModifiers does not need to be observable
dataTables/grid knockout
examples
https://github.com/CogShift/Knockout.Extensions
https://github.com/CogShift/Knockout.Extensions/issues/9
https://github.com/Knockout-Contrib/KoGrid
http://chadmullins.com/javascript/knockout-js-series-part-2-binding-knockout-js-to-a-datatables-grid/
inbox
on new message (can be a newMessage update event), just add to messages list rather than always refreshing
player_
face display with forward/back button?
some things become observables - why???
mapping function not run right the second time - try to create jsfiddle
arrays are becoming observableArrays
schedule, teamHistory
partial load of list for updates, like in gameLog list
freeagents
optimize refreshes
dist
allow updating box plots without refresh
gameLog
set more stuff through mapping
reassess dropdown - should it really be called like it is in uiEvery? can i use a computed? problem is, some things need to listen to updateEvents too, not just observables
---
g = require("globals"); g.dbl.transaction("draftPicks").objectStore("draftPicks").index("season").getAll(g.season).onsuccess = function (event) { console.log(event.target.result); };
g = require("globals"); player = require("core/player"); g.dbl.transaction("players").objectStore("players").get(184).onsuccess = function (event) { console.log(player.genContract(event.target.result)); };
g = require("globals"); g.dbl.transaction("players").objectStore("players").get(184).onsuccess = function (event) { console.log(event.target.result); };
g = require("globals"); player = require("core/player"); g.dbl.transaction("players").objectStore("players").get(170).onsuccess = function (event) { console.log(player.madeHof(event.target.result)); };
g = require("globals"); player = require("core/player"); g.dbl.transaction("players").objectStore("players").get(172).onsuccess = function (event) { console.log(player.madeHof(event.target.result)); };
g = require("globals"); g.dbl.transaction("players").objectStore("players").openCursor(null, "prev").onsuccess = function(event) { console.log(event.target.result.value); };
g = require("globals"); g.dbl.transaction("teams").objectStore("teams").get(3).onsuccess = function (event) { console.log(event.target.result.seasons[0]); }
g = require("globals"); g.dbl.transaction("releasedPlayers").objectStore("releasedPlayers").getAll().onsuccess = function (event) { console.log(event.target.result); }
g.dbl.transaction("gameAttributes").objectStore("gameAttributes").getAll().onsuccess = function (event) { console.dir(event.target.result); };
g = require("globals"); g.dbl.transaction("messages").objectStore("messages").getAll().onsuccess = function (event) { console.dir(event.target.result); };
// Switch teams
var g = require('globals'); g.dbl.transaction("gameAttributes", "readwrite").objectStore("gameAttributes").openCursor("userTid").onsuccess = function (event) { var c = event.target.result; console.log(c.value); c.value.value = 26; console.log(c.value); c.update(c.value); };
---
git fetch origin pull/8/head:pr-8
---
# Pre-JavaScript TODO
player view
next, previous buttons (also active on left/right arrows)
roster
highlight handle on hover, like button
"trade for" only sensitive when trades are allowed
Client-side game simulation
Robustness of javascript code
g.phase == 3 in league_views might introduce race condition
validate data from client?
make sure play menu doesn't ever get stuck - some kind of timeout
play button requirements
colors - is this a good idea?
green: move to new phase
blue: play games
red: other immediate action
make validate_season work correctly
include sidebar(s) showing all relevant information, plus make that stuff generated by a separate function so it can eventually be kept static as JS updates other content
grep for # links: grep -R --include="*.html" '<a href="#">' .
security
csrf protection
http://flask.pocoo.org/docs/security/#cross-site-request-forgery-csrf
http://packages.python.org/Flask-SeaSurf/
http://flask.pocoo.org/snippets/3/
even for ajax https://docs.djangoproject.com/en/1.2/releases/1.2.5/#csrf-exception-for-ajax-requests
# Then
self-contained game simulation code, to allow other people to hack on it easily. automatically make charts and stuff.
warning when window is closed and game simulation is in progress
http://stackoverflow.com/questions/1244535/alert-when-browser-window-closed-accidentally
https://developer.mozilla.org/en/DOM/window.onbeforeunload
# BELOW IS OLD STUFF
Minor bugs:
Don't allow sort from first column of trade window
UI
--
in team stats tab, allow toggle to show opponent stats
NBA
---
real salary cap rules: http://en.wikipedia.org/wiki/NBA_Salary_Cap
real contract rules (max/min, etc.)
allow contracts that aren't the same $ every year
team and player options
releasing players - see the salary cap wiki page for complicated rule
trading deadline
AI (NON-GAMESIM)
----------------
trade
AI teams trade with each other
Feedback from trades (way off, that's close, etc)
"Oh, you again?" after failed trade attempts
AI teams should be aware of contract lengths and the implications thereof
AI teams release/buy out players to sign a better free agent
FEATURES
--------
multi-team trades... how can i make a good UI for that?